forked from opentiny/tiny-vue
docs(sites): fix site overview input error (#1499)
This commit is contained in:
parent
8523a35980
commit
ef5374396a
|
@ -12,10 +12,10 @@
|
|||
<!-- 搜索 -->
|
||||
<tiny-input
|
||||
:placeholder="i18nByKey('searchComponents')"
|
||||
v-model="value"
|
||||
:modelValue="value"
|
||||
class="ti-mb10 search-input"
|
||||
:style="{ width: '100%', padding: '6px' }"
|
||||
@input="searchHandler"
|
||||
@update:modelValue="searchHandler"
|
||||
>
|
||||
<template #suffix>
|
||||
<img class="ti-h24 ti-w24 cur-def" :src="searchSvg" />
|
||||
|
@ -94,8 +94,8 @@ export default defineComponent({
|
|||
}, delay)
|
||||
}
|
||||
}
|
||||
function searchResultFn(event) {
|
||||
const value = event
|
||||
function searchResultFn(val) {
|
||||
const value = val
|
||||
const trimValue = value.replaceAll(' ', '').toLowerCase()
|
||||
const currentValue = trimValue
|
||||
const reg = new RegExp(currentValue, 'ig')
|
||||
|
@ -120,9 +120,13 @@ export default defineComponent({
|
|||
const { defaultThemeKey } = useTheme()
|
||||
const { all: allPathParam, theme = defaultThemeKey } = useRoute().params
|
||||
const allPath = allPathParam ? allPathParam + '/' : ''
|
||||
const debounceSearch = debounce(searchResultFn, 300)
|
||||
|
||||
let fn = {
|
||||
searchHandler: debounce(searchResultFn, 300),
|
||||
searchHandler: (val) => {
|
||||
state.value = val
|
||||
debounceSearch(val)
|
||||
},
|
||||
getTo: (key) => `${import.meta.env.VITE_CONTEXT}${allPath}${lang}/${theme}/components/${key}`,
|
||||
getSvg: (key) => {
|
||||
// 表格示例单独另起了许多路由,统一使用表格组件图标
|
||||
|
|
Loading…
Reference in New Issue