全局下拉框添加filterable属性

This commit is contained in:
guanj
2026-07-15 09:21:35 +08:00
parent 04c5eb7185
commit dc3b3cfc74
166 changed files with 8767 additions and 8649 deletions

View File

@@ -1,9 +1,13 @@
<template>
<el-main class="layout-main" :style="mainHeight()">
<router-view v-slot="{ Component }">
<transition :name="config.layout.mainAnimation">
<router-view v-slot="{ Component, route: viewRoute }">
<transition :name="config.layout.mainAnimation" mode="out-in">
<keep-alive :include="state.keepAliveComponentNameList">
<component :is="Component" :key="state.componentKey || undefined" />
<component
:is="Component"
v-if="Component"
:key="state.componentKey || viewRoute.fullPath"
/>
</keep-alive>
</transition>
</router-view>
@@ -51,9 +55,10 @@ onBeforeMount(() => {
state.keepAliveComponentNameList = state.keepAliveComponentNameList.filter(
(name: string) => menu.meta.keepalive !== name
)
state.componentKey = ''
// 临时换 key 强制卸载,再在 nextTick 恢复为路由 fullPath避免 keep-alive 缓存错乱
state.componentKey = `${menu.fullPath || menu.path}__refresh__${Date.now()}`
nextTick(() => {
state.componentKey = menu.path
state.componentKey = ''
addKeepAliveComponentName(menu.meta.keepalive as string)
})
})