mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-12 12:25:16 +08:00
1.1 KiB
1.1 KiB
items
<n-menu :title="'Test'"
v-model="selected"
:defaultOpenNames="initOpenKeys"
:openNames="opens"
@openNamesChange="changeOpen"
@select="changeSelect"
:items="items"
>
</n-menu>
export default {
data () {
return {
selected: 'sub1',
initOpenKeys: ['subMenu', "subMenu2","subMenu22"],
opens: ['subMenu'],
items: [
{
title: 'menu1',
name: 'menu1',
disabled: true,
},
{
title: 'subMenu',
name: 'subMenu',
groupTitle: 'group1',
children: [
{
title:'sub1',
name: 'sub1',
children: [
{
title: 'subsub001',
name: 'subsub001'
},
{
title: 'subsub002',
name: 'subsub002'
}
]
}
]
}
]
}
},
methods: {
changeOpen (indexs) {
console.log('indexs', indexs)
},
changeSelect (val) {
console.log('changeSelect', val)
}
}
};