naive-ui/demo/documentation/components/dropdown/enUS/cascade.md

54 lines
1.1 KiB
Markdown
Raw Normal View History

2019-10-22 13:48:51 +08:00
# Cascade
```html
<n-dropdown
placement="bottom-start"
2019-12-01 22:55:39 +08:00
trigger="click"
@select="handleSelect"
2019-10-22 13:48:51 +08:00
>
<template v-slot:activator>
2019-12-03 21:48:34 +08:00
<n-button>People and Some Food to Eat</n-button>
2019-10-22 13:48:51 +08:00
</template>
2019-12-03 21:48:34 +08:00
<n-dropdown-item name="jay gatsby">
Jay Gatsby
2019-10-22 13:48:51 +08:00
</n-dropdown-item>
2019-12-03 21:48:34 +08:00
<n-dropdown-item name="daisy buchanan">
Daisy Buchanan
2019-10-22 13:48:51 +08:00
</n-dropdown-item>
<n-dropdown-divider />
2019-12-03 21:48:34 +08:00
<n-dropdown-item name="nick carraway">
Nick Carraway
2019-10-22 13:48:51 +08:00
</n-dropdown-item>
<n-dropdown-submenu>
<template v-slot:activator>
Others
2019-10-22 13:48:51 +08:00
</template>
<n-dropdown-item name="jordan baker">
Jordan Baker
2019-10-22 13:48:51 +08:00
</n-dropdown-item>
<n-dropdown-divider />
<n-dropdown-item name="tom buchanan">
Tom Buchanan
2019-10-22 13:48:51 +08:00
</n-dropdown-item>
<n-dropdown-submenu>
<template v-slot:activator>
Others
2019-10-22 13:48:51 +08:00
</template>
<n-dropdown-item name="chicken">
Chicken
2019-10-22 13:48:51 +08:00
</n-dropdown-item>
<n-dropdown-item name="beef">
Beef
2019-10-22 13:48:51 +08:00
</n-dropdown-item>
</n-dropdown-submenu>
</n-dropdown-submenu>
</n-dropdown>
```
```js
export default {
methods: {
handleSelect (name) {
this.$NMessage.info(name)
}
}
}
2019-10-22 13:48:51 +08:00
```