mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-12 12:25:16 +08:00
32 lines
662 B
Markdown
32 lines
662 B
Markdown
# 弹出位置
|
|
```html
|
|
<n-dropdown @select="handleSelect" placement="bottom-start" :focusable="false">
|
|
<template v-slot:activator>
|
|
<n-button>金钱所迫,起床工作</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: [
|
|
'滨海湾金沙,新加坡', '布朗酒店,伦敦', '亚特兰蒂斯巴哈马,拿骚', '比佛利山庄酒店,洛杉矶'
|
|
]
|
|
}
|
|
},
|
|
methods: {
|
|
handleSelect (name) {
|
|
this.$NMessage.info(name)
|
|
}
|
|
}
|
|
}
|
|
```
|