naive-ui/demo/documentation/components/dropdown/enUS/placement.md
2019-12-03 20:00:29 +08:00

31 lines
646 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Placement
```html
<n-dropdown @select="handleSelect" placement="bottom-start" :focusable="false">
<template v-slot:activator>
<n-button>I want to go sleep!</n-button>
</template>
<n-dropdown-item
v-for="hotel in hotels"
:key="hotel"
:name="hotel.toLowerCase()"
>
{{ hotel }}
</n-dropdown-item>
</n-dropdown>
```
```js
export default {
data () {
return {
hotels: [
'Marina Bay Sands, Singapore', 'Browns Hotel, London', 'Atlantis Bahamas, Nassau', 'The Beverly Hills Hotel, Los Angeles'
]
}
},
methods: {
handleSelect (name) {
this.$NMessage.info(name)
}
}
}
```