mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-12 12:25:16 +08:00
487001d697
.demo.md for component demo .demo-entry.md for demo entry .md for common docs
77 lines
1.4 KiB
Markdown
77 lines
1.4 KiB
Markdown
# 基础用法
|
|
|
|
```html
|
|
<n-popselect
|
|
v-model="value"
|
|
:options="options"
|
|
@change="handleChange"
|
|
>
|
|
<n-tag>{{ value || '弹出选择' }}</n-tag>
|
|
</n-popselect>
|
|
```
|
|
```js
|
|
export default {
|
|
data () {
|
|
return {
|
|
value: 'Drive My Car',
|
|
options: [
|
|
{
|
|
label: 'Drive My Car',
|
|
value: 'Drive My Car'
|
|
},
|
|
{
|
|
label: 'Norwegian Wood',
|
|
value: 'Norwegian Wood'
|
|
},
|
|
{
|
|
label: 'You Won\'t See',
|
|
value: 'You Won\'t See',
|
|
disabled: true
|
|
},
|
|
{
|
|
label: 'Nowhere Man',
|
|
value: 'Nowhere Man'
|
|
},
|
|
{
|
|
label: 'Think For Yourself',
|
|
value: 'Think For Yourself'
|
|
},
|
|
{
|
|
label: 'The Word',
|
|
value: 'The Word'
|
|
},
|
|
{
|
|
label: 'Michelle',
|
|
value: 'Michelle',
|
|
disabled: true
|
|
},
|
|
{
|
|
label: 'What goes on',
|
|
value: 'What goes on'
|
|
},
|
|
{
|
|
label: 'Girl',
|
|
value: 'Girl'
|
|
},
|
|
{
|
|
label: 'I\'m looking through you',
|
|
value: 'I\'m looking through you'
|
|
},
|
|
{
|
|
label: 'In My Life',
|
|
value: 'In My Life'
|
|
},
|
|
{
|
|
label: 'Wait',
|
|
value: 'Wait'
|
|
}
|
|
]
|
|
}
|
|
},
|
|
methods: {
|
|
handleChange (v) {
|
|
this.$NMessage.info('值:' + v)
|
|
}
|
|
}
|
|
}
|
|
``` |