fix:添加页面缓存

This commit is contained in:
lz-ui 2025-09-28 15:07:58 +08:00
parent ab4be9ad69
commit bf4d4e3b9e
4 changed files with 24 additions and 7 deletions

View File

@ -66,8 +66,8 @@ function addIframe() {
}
.fixed-header + .app-main {
margin-top: var(--app-header-height) + 34px;
height: calc(100vh - var(--app-header-height) - 34px);
// margin-top: var(--app-header-height) + 34px;
height: calc(100vh - var(--app-header-height));
min-height: 0px;
}
}

View File

@ -5,7 +5,7 @@
<div :class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }" class="main-container">
<div :class="{ 'fixed-header': fixedHeader }">
<navbar @setLayout="setLayout" />
<tags-view v-if="needTagsView" />
<tags-view v-if="needTagsView" v-show="false"/>
</div>
<app-main />
<settings ref="settingRef" />

View File

@ -27,7 +27,7 @@ export default {
/**
* 是否显示 tagsView
*/
tagsView: false,
tagsView: true,
/**
* 显示页签图标

View File

@ -8,13 +8,30 @@
</template>
<script setup name="VideoScript">
import { ref } from 'vue'
import { ref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import soccer from './components/soccer.vue'
import basketball from './components/basketball.vue'
const activeName = ref('soccer')
const route = useRoute()
const router = useRouter()
// URLactiveName'soccer'
const activeName = ref(route.query.tab || 'soccer')
// activeNameURL
watch(activeName, (newVal) => {
router.replace({
query: {
...route.query,
tab: newVal
}
})
})
const handleClick = (tab, event) => {
console.log(tab, event)
console.log('点击标签页:', tab.props.name)
}
</script>