mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-31 13:21:01 +08:00
fix(search): Input method optimization
- 合成文字输入法的支持,允许输入到中途进行暂停等操作,而不打断输入触发高频事件
This commit is contained in:
@@ -11,6 +11,7 @@ import router from '@/router'
|
||||
import { useDisplay } from 'vuetify'
|
||||
import { storageDict } from '@/api/constants'
|
||||
import { VIcon } from 'vuetify/lib/components/index.mjs'
|
||||
import { L } from '@fullcalendar/list/internal-common'
|
||||
|
||||
// APP
|
||||
const display = useDisplay()
|
||||
@@ -22,6 +23,9 @@ const $toast = useToast()
|
||||
// 路由
|
||||
const route = useRoute()
|
||||
|
||||
// 组合输入状态
|
||||
const isComposing = ref(false)
|
||||
|
||||
// 重新整理对话框
|
||||
const redoDialog = ref(false)
|
||||
|
||||
@@ -149,7 +153,7 @@ const totalPage = computed(() => {
|
||||
return total
|
||||
})
|
||||
|
||||
// 切换页签和搜索词
|
||||
// 切换页签
|
||||
watch(
|
||||
[() => currentPage.value, () => itemsPerPage.value],
|
||||
debounce(async () => {
|
||||
@@ -157,12 +161,13 @@ watch(
|
||||
}, 1000),
|
||||
)
|
||||
|
||||
watch(
|
||||
[() => search.value],
|
||||
debounce(async () => {
|
||||
// 搜索监听
|
||||
watch([() => search.value, () => isComposing.value], async () => {
|
||||
if (!isComposing.value) {
|
||||
console.log('search: ' + search.value)
|
||||
reloadPage(true)
|
||||
}, 1000),
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
// 获取订阅列表数据
|
||||
async function fetchData(page = currentPage.value, count = itemsPerPage.value) {
|
||||
@@ -371,6 +376,8 @@ onMounted(fetchData)
|
||||
key="search_navbar"
|
||||
v-model="search"
|
||||
:items="searchHintList"
|
||||
@compositionstart="isComposing = true"
|
||||
@compositionend="isComposing = false"
|
||||
class="text-disabled"
|
||||
density="compact"
|
||||
label="搜索整理记录"
|
||||
|
||||
Reference in New Issue
Block a user