feat 侧边栏显示选中

This commit is contained in:
timerzz 2024-12-03 10:21:34 +08:00
parent 910a020741
commit 786217f2af

View File

@ -5,21 +5,28 @@
style="width: 256px;"
mode="inline"
:items="items"
:selectedKeys="selectedKeys"
></a-menu>
</template>
<script setup>
import {AccountBookOutlined,FundOutlined, BellOutlined, DollarCircleOutlined, HddOutlined, DeploymentUnitOutlined, ToolOutlined} from "@ant-design/icons-vue";
import {h} from "vue";
import {useRouter} from "vue-router";
import {computed, h, ref} from "vue";
import {useRoute, useRouter} from "vue-router";
const router = useRouter()
const route = useRoute()
const onclick = ({key}) => {
router.push({
path: '/'+key
})
}
const selectedKeys = computed(()=>{
return [route.path.split('/')[1]]
})
const items = [
{
key: 'article',
@ -65,8 +72,6 @@ const items = [
}
]
</script>
<style scoped>