vue element select下拉框回显展示数字
- 问题截图:
下拉框显示数字可以从数据类型来分析错误,接收的数据类型是字符串
,但是value
是数字
类型
<el-form-item prop="classifyLabelId" :label="$t('item.classifyLabelId')">
<el-select v-model="dataForm.classifyLabelId" clearable placeholder="请选择">
<el-option v-for="classifyLabel in classifyLabelOptions" :key="classifyLabel.id" :label="classifyLabel.label" :value="classifyLabel.id">
</el-option>
</el-select>
</el-form-item>
传的参数和接收的数据类型一直才不会出现错误,所以将value
改成字符串
就可以了文章来源地址https://www.toymoban.com/news/detail-586042.html
<el-form-item prop="classifyLabelId" :label="$t('item.classifyLabelId')">
<el-select v-model="dataForm.classifyLabelId" clearable placeholder="请选择">
<el-option v-for="classifyLabel in classifyLabelOptions" :key="classifyLabel.id" :label="classifyLabel.label" :value="classifyLabel.id + ''">
</el-option>
</el-select>
</el-form-item>
文章来源:https://www.toymoban.com/news/detail-586042.html
到了这里,关于vue element select下拉框回显展示数字的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!