mirror of
https://gitcode.com/yangzongzhuan/RuoYi-Vue3.git
synced 2026-05-22 19:08:37 +00:00
update TopBar/index.vue
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import SidebarItem from '../Sidebar/SidebarItem'
|
import SidebarItem from '../Sidebar/SidebarItem.vue'
|
||||||
import useAppStore from '@/store/modules/app'
|
import useAppStore from '@/store/modules/app'
|
||||||
import useSettingsStore from '@/store/modules/settings'
|
import useSettingsStore from '@/store/modules/settings'
|
||||||
import usePermissionStore from '@/store/modules/permission'
|
import usePermissionStore from '@/store/modules/permission'
|
||||||
@@ -35,14 +35,14 @@ const activeMenu = computed(() => {
|
|||||||
|
|
||||||
const visibleNumber = ref<number>(5)
|
const visibleNumber = ref<number>(5)
|
||||||
const topMenus = computed(() => {
|
const topMenus = computed(() => {
|
||||||
return permissionStore.sidebarRouters.filter((f) => !f.hidden).slice(0, visibleNumber.value)
|
return permissionStore.sidebarRouters.filter((f: any) => !f.hidden).slice(0, visibleNumber.value)
|
||||||
})
|
})
|
||||||
const moreRoutes = computed(() => {
|
const moreRoutes = computed(() => {
|
||||||
return permissionStore.sidebarRouters.filter((f) => !f.hidden).slice(visibleNumber.value, sidebarRouters.value.length - visibleNumber.value)
|
return permissionStore.sidebarRouters.filter((f: any) => !f.hidden).slice(visibleNumber.value, sidebarRouters.value.length - visibleNumber.value)
|
||||||
})
|
})
|
||||||
function setVisibleNumber(): void {
|
function setVisibleNumber(): void {
|
||||||
const width = document.body.getBoundingClientRect().width / 3
|
const width = document.body.getBoundingClientRect().width / 3
|
||||||
visibleNumber.value = parseInt(width / 85)
|
visibleNumber.value = parseInt(String(width / 85))
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user