2019-11-27 17:01:21 +08:00
|
|
|
# Basic
|
|
|
|
```html
|
2019-12-31 11:36:13 +08:00
|
|
|
<div>
|
2019-12-27 13:49:00 +08:00
|
|
|
<n-menu
|
2019-11-27 17:01:21 +08:00
|
|
|
v-model="selected"
|
|
|
|
@openNamesChange="changeOpen"
|
|
|
|
@select="changeSelect"
|
2020-01-13 23:06:58 +08:00
|
|
|
>
|
2019-11-27 17:01:21 +08:00
|
|
|
<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">
|
2019-11-27 17:01:21 +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"></n-menu-item>
|
2020-01-15 15:22:29 +08:00
|
|
|
</n-submenu>
|
|
|
|
</n-submenu>
|
|
|
|
<n-submenu title="subMenu3" name="subMenu3">
|
2020-01-15 13:00:43 +08:00
|
|
|
<n-menu-item title="sub1" name="sub8"></n-menu-item>
|
|
|
|
<n-menu-item title="sub1" name="sub6"></n-menu-item>
|
|
|
|
<n-menu-item title="sub1" name="sub7"></n-menu-item>
|
2020-01-15 15:22:29 +08:00
|
|
|
</n-submenu>
|
2019-11-27 17:01:21 +08:00
|
|
|
</n-menu>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
```
|
|
|
|
```js
|
|
|
|
export default {
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
selected: 'sub1',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
changeOpen (names) {
|
|
|
|
console.log('names', names)
|
|
|
|
},
|
|
|
|
changeSelect (val) {
|
|
|
|
console.log('changeSelect', val)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
```
|