问题描述:
在edit.html中,获取list.html传来的id,用id查询信息然后显示到edit.html的各个对应的位置中
下拉框选择一个数据,再点保存,提示 “xx不能为空”、
下拉框选择一个数据,显示正确,但是换到其他input中,只要输入,下拉框就变回原来的值
Html 代码:
<select style="width:100%" v-model="cmdMaterialStorage.repertoryId"
isvalid="yes" required checkexpession='NotNull'>
<option value="0" selected="selected">请选择</option>
<option v-for="option in repertoryList" v-bind:value="option.rertoryId">
<!--通过循环,取出id和name-->
{{ option.repertoryName }}
</option>
</select>
解决方案:
查看是否字符写错或者没有对应,比如我的下拉框的repertoryId拿不到,原因是因为实体类中写的是 id
<select style="width:100%" v-model="cmdMaterialStorage.repertoryId"
isvalid="yes" required checkexpession='NotNull'>
<option value="0" selected="selected">请选择</option>
<option v-for="option in repertoryList" v-bind:value="option.id">
<!--通过循环,取出id和name-->
{{ option.repertoryName }}
</option>
</select>