Vue element ui 中 select 下拉框不回顯:
項(xiàng)目場(chǎng)景:最近在使用vue element-ui 寫后臺(tái)時(shí)候,發(fā)現(xiàn)select 下拉不回顯,于是發(fā)現(xiàn)問題,記錄
問題描述
例如:數(shù)據(jù)傳輸過程中數(shù)據(jù)不時(shí)出現(xiàn)丟失的情況,偶爾會(huì)丟失一部分?jǐn)?shù)據(jù)
APP 中接收數(shù)據(jù)代碼:
<el-form-item label="企業(yè)性質(zhì)" prop="nature">
<el-select v-model="temp.nature" placeholder="請(qǐng)選擇" style="width: 200px;">
<el-option
v-for="item in companyNatureList"
:key="item.value"
:label="item.label"
:value="item.value"
style="width: 200px;overflow: hidden;text-overflow: ellipsis"/>
</el-select>
</el-form-item>
data中初始值
companyNatureList: [{'label': '專業(yè)公司', 'value': '1'},
{'label': '基礎(chǔ)電信企業(yè)', 'value': '2'}]
請(qǐng)求返回值
createDate: "2022-10-11 14:19:27"
defaultFlag: 0
delFlag: "0"
id: "7cf2497cd7984f46b9e65f4360050183"
name: "xx"
nature: 1
region: 110000
type: 1
其中:nature為需要回顯的值
原因分析:
提示:這里填寫問題的分析:
發(fā)現(xiàn)select下拉的id和v-model里邊的id類型不一致。
解決方案:
修改后臺(tái)下拉框數(shù)據(jù)源返回類型,下拉框顯示數(shù)據(jù)成功文章來源:http://www.zghlxwxcb.cn/news/detail-731742.html
文章來源地址http://www.zghlxwxcb.cn/news/detail-731742.html
到了這里,關(guān)于element ui select下拉框不回顯的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!