mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-24 12:45:18 +08:00
29 lines
514 B
Markdown
29 lines
514 B
Markdown
# Placement
|
|
```html
|
|
<n-dropdown placement="bottom-start">
|
|
<template v-slot:activator>
|
|
<div>menu</div>
|
|
</template>
|
|
<n-dropdown-item
|
|
v-for="item in items"
|
|
:key="item"
|
|
@click="handleClick(item)"
|
|
>
|
|
{{ item }}
|
|
</n-dropdown-item>
|
|
</n-dropdown>
|
|
```
|
|
```js
|
|
export default {
|
|
data () {
|
|
return {
|
|
items: ['item1longlonglong', 'item2longlonglong', 'item3longlonglong', 'item4longlonglong']
|
|
}
|
|
},
|
|
methods: {
|
|
handleClick (item) {
|
|
this.$NMessage.info(item)
|
|
}
|
|
}
|
|
}
|
|
``` |