mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 23:56:42 +08:00
Merge pull request #278 from Aqr-K/fix/search
fix(search): Input method optimization
This commit is contained in:
@@ -10,7 +10,6 @@ import { useRoute } from 'vue-router'
|
|||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
import { useDisplay } from 'vuetify'
|
import { useDisplay } from 'vuetify'
|
||||||
import { storageDict } from '@/api/constants'
|
import { storageDict } from '@/api/constants'
|
||||||
import { VIcon } from 'vuetify/lib/components/index.mjs'
|
|
||||||
|
|
||||||
// APP
|
// APP
|
||||||
const display = useDisplay()
|
const display = useDisplay()
|
||||||
@@ -22,6 +21,9 @@ const $toast = useToast()
|
|||||||
// 路由
|
// 路由
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
|
// 组合式输入法状态
|
||||||
|
const isComposing = ref(false)
|
||||||
|
|
||||||
// 重新整理对话框
|
// 重新整理对话框
|
||||||
const redoDialog = ref(false)
|
const redoDialog = ref(false)
|
||||||
|
|
||||||
@@ -149,7 +151,7 @@ const totalPage = computed(() => {
|
|||||||
return total
|
return total
|
||||||
})
|
})
|
||||||
|
|
||||||
// 切换页签和搜索词
|
// 切换页签
|
||||||
watch(
|
watch(
|
||||||
[() => currentPage.value, () => itemsPerPage.value],
|
[() => currentPage.value, () => itemsPerPage.value],
|
||||||
debounce(async () => {
|
debounce(async () => {
|
||||||
@@ -157,12 +159,13 @@ watch(
|
|||||||
}, 1000),
|
}, 1000),
|
||||||
)
|
)
|
||||||
|
|
||||||
watch(
|
// 搜索监听
|
||||||
[() => search.value],
|
watch([() => search.value, () => isComposing.value], async () => {
|
||||||
debounce(async () => {
|
if (!isComposing.value) {
|
||||||
|
console.log('search: ' + search.value)
|
||||||
reloadPage(true)
|
reloadPage(true)
|
||||||
}, 1000),
|
}
|
||||||
)
|
})
|
||||||
|
|
||||||
// 获取订阅列表数据
|
// 获取订阅列表数据
|
||||||
async function fetchData(page = currentPage.value, count = itemsPerPage.value) {
|
async function fetchData(page = currentPage.value, count = itemsPerPage.value) {
|
||||||
@@ -371,6 +374,8 @@ onMounted(fetchData)
|
|||||||
key="search_navbar"
|
key="search_navbar"
|
||||||
v-model="search"
|
v-model="search"
|
||||||
:items="searchHintList"
|
:items="searchHintList"
|
||||||
|
@compositionstart="isComposing = true"
|
||||||
|
@compositionend="isComposing = false"
|
||||||
class="text-disabled"
|
class="text-disabled"
|
||||||
density="compact"
|
density="compact"
|
||||||
label="搜索整理记录"
|
label="搜索整理记录"
|
||||||
|
|||||||
Reference in New Issue
Block a user