useMenu
代码演示
设置徽标
vue
<template>
<div>
<a-button
type="primary"
@click="handleClick">
设置徽标
</a-button>
</div>
</template>
<script setup>
import { useMenu } from '@/hooks'
const { setBadge } = useMenu()
function handleClick() {
setBadge('home', 1)
}
</script>
<style lang="less" scoped></style>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21