naive-ui/demo/documentation/components/popselect/zhCN/customWidth.md
2020-02-04 15:10:51 +08:00

43 lines
777 B
Markdown

# 自定义宽度
设个宽度吧。
```html
<n-popselect
v-model="value"
:width="240"
multiple
:options="options"
@change="handleChange"
>
<n-tag>{{ (Array.isArray(value) && value.length) ? value : '弹出选择' }}</n-tag>
</n-popselect>
```
```js
export default {
data () {
return {
value: null,
options: [{
label: 'Go Let It Out',
value: 'Go Let It Out'
}, {
label: 'Who Feels Love?',
value: 'Who Feels Love?'
}, {
label: 'Sunday Morning Call',
value: 'Sunday Morning Call',
disabled: true
}, {
label: 'Roll It Over',
value: 'Roll It Over'
}]
}
},
methods: {
handleChange (v) {
this.$NMessage.info('值:' + v)
}
}
}
```