add router search

This commit is contained in:
wangding
2023-05-29 11:26:51 +08:00
parent 6768cdea05
commit 43f3c67434
3 changed files with 51 additions and 51 deletions

View File

@@ -8,7 +8,7 @@
"source.fixAll.eslint": true
},
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "Vue.volar"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"

View File

@@ -3,8 +3,7 @@ import { isDark } from '@/utils/is'
import { useAppStore } from '@/store/modules/app'
import { useDesign } from '@/hooks/web/useDesign'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import routerSearch from '@/components/RouterSearch'
import routerSearch from '@/components/RouterSearch/index.vue'
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('app')
@@ -31,6 +30,7 @@ setDefaultTheme()
</template>
<style lang="scss">
$prefix-cls: #{$namespace}-app;
.size {
width: 100%;
height: 100%;

View File

@@ -6,7 +6,7 @@
remote
placeholder="请输入菜单内容"
:remote-method="remoteMethod"
style="width: 100%;"
style="width: 100%"
@change="handleChange"
>
<el-option
@@ -25,7 +25,8 @@ const showSearch = ref(false) // 是否显示弹框
const value: Ref = ref('') // 用户输入的值
const routers = router.getRoutes() // 路由对象
const options = computed(() => { // 提示选项
const options = computed(() => {
// 提示选项
if (!value.value) {
return []
}
@@ -42,7 +43,6 @@ const options = computed(() => { // 提示选项
})
})
function remoteMethod(data) {
// 这里可以执行相应的操作(例如打开搜索框等)
value.value = data