官方使用DEMO
<template>
<el-select v-model="value" placeholder="請(qǐng)選擇">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</template>
<script>
export default {
data() {
return {
options: [{
value: '選項(xiàng)1',
label: '黃金糕'
}, {
value: '選項(xiàng)2',
label: '雙皮奶'
}, {
value: '選項(xiàng)3',
label: '蚵仔煎'
}, {
value: '選項(xiàng)4',
label: '龍須面'
}, {
value: '選項(xiàng)5',
label: '北京烤鴨'
}],
value: ''
}
}
}
</script>
1.修改下拉框的寬度
:popper-append-to-body="false"
文章來源:http://www.zghlxwxcb.cn/news/detail-811608.html
<template>
<el-select v-model="value" placeholder="請(qǐng)選擇">
<el-option
v-for="item in options"
:popper-append-to-body="false"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</template>
2.下拉框篩選不顯示某條數(shù)據(jù)
v-if="item.value !== form.id"文章來源地址http://www.zghlxwxcb.cn/news/detail-811608.html
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
v-if="item.value !== form.id"
>
</el-option>
到了這里,關(guān)于【elementUI】el-select相關(guān)問題的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!