2019-12-31 11:36:13 +08:00
|
|
|
# Disabled
|
|
|
|
```html
|
|
|
|
<div>
|
|
|
|
Slot:
|
|
|
|
<n-menu
|
|
|
|
v-model="selected"
|
|
|
|
:defaultOpenNames="initOpenKeys"
|
|
|
|
@openNamesChange="changeOpen"
|
|
|
|
@select="changeSelect"
|
2019-12-31 18:22:45 +08:00
|
|
|
>
|
2019-12-31 11:36:13 +08:00
|
|
|
<template v-slot:drawer-header-icon>
|
|
|
|
<div style="overflow:hidden">1111</div>
|
|
|
|
</template>
|
|
|
|
<n-menu-item title="num1" name="num1"></n-menu-item>
|
|
|
|
<n-menu-item title="num2" name="num2"></n-menu-item>
|
|
|
|
<n-menu-item title="num3" name="num3"></n-menu-item>
|
2020-01-15 15:22:29 +08:00
|
|
|
<n-submenu title="subMenu" name="subMenu" disabled>
|
2019-12-31 11:36:13 +08:00
|
|
|
<n-menu-item title="sub1" name="sub1"></n-menu-item>
|
2020-01-15 15:22:29 +08:00
|
|
|
</n-submenu>
|
|
|
|
<n-submenu title="subMenu2" name="subMenu2">
|
|
|
|
<n-submenu title="subMenu22" name="subMenu22">
|
2019-12-31 11:36:13 +08:00
|
|
|
<n-menu-item title="sub222" name="sub222" disabled></n-menu-item>
|
2020-01-15 15:22:29 +08:00
|
|
|
</n-submenu>
|
|
|
|
</n-submenu>
|
|
|
|
<n-submenu title="subMenu3" name="subMenu3">
|
2019-12-31 18:22:45 +08:00
|
|
|
<n-menu-item-group title="group">
|
2019-12-31 11:36:13 +08:00
|
|
|
<n-menu-item title="sub1" name="sub6"></n-menu-item>
|
|
|
|
<n-menu-item title="sub1" name="sub7"></n-menu-item>
|
2019-12-31 18:22:45 +08:00
|
|
|
</n-menu-item-group>
|
2020-01-15 15:22:29 +08:00
|
|
|
</n-submenu>
|
2019-12-31 11:36:13 +08:00
|
|
|
</n-menu>
|
|
|
|
Items:
|
|
|
|
<n-menu
|
2019-12-31 18:22:45 +08:00
|
|
|
v-model="selected"
|
|
|
|
:openNames="opens"
|
|
|
|
:items="items"
|
|
|
|
@select="changeSelect"
|
|
|
|
@openNamesChange="changeOpen"
|
|
|
|
/>
|
2019-12-31 11:36:13 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
```
|
|
|
|
```js
|
|
|
|
export default {
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
selected: 'sub1',
|
|
|
|
initOpenKeys: [],
|
|
|
|
opens: [],
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
title: 'menu1',
|
|
|
|
name: 'menu1',
|
|
|
|
disabled: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'subMenu',
|
|
|
|
name: 'subMenu',
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
title:'sub1',
|
2019-12-31 18:22:45 +08:00
|
|
|
group: true,
|
2019-12-31 11:36:13 +08:00
|
|
|
name: 'sub1',
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
title: 'subsub001',
|
|
|
|
name: 'subsub001'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'subsub002',
|
|
|
|
name: 'subsub002'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
changeOpen (names) {
|
2019-12-31 18:22:45 +08:00
|
|
|
this.opens = names
|
2019-12-31 11:36:13 +08:00
|
|
|
console.log('names', names)
|
|
|
|
},
|
2019-12-31 18:22:45 +08:00
|
|
|
changeSelect (name) {
|
|
|
|
this.selected = name
|
2019-12-31 11:36:13 +08:00
|
|
|
console.log('changeSelect', val)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
```
|
|
|
|
```css
|
|
|
|
|
|
|
|
```
|