关于elementui 中select选中值绑定为对象时
来源:互联网 发布:淘宝如何打上新品标签 编辑:程序博客网 时间:2024/06/16 09:46
注:值为对象类型时,需要提供一个 value-key
作为唯一性标识
HTML:
<el-form-item v-if="item.type=='fncsel' && item.grid!='two'" :label="item.label" :class='{"is-required":item.required}'>
<el-select class="fl" placeholder="请选择" value-key="name" v-model="item.value" @visible-change="fncselvchange(item)" @change="formChangeFun"><el-option v-for="option in item.options" :key="option.name" :value="option" :label="option.name" :id="option.id"></el-option>
</el-select>
<i v-if="item.oper" class="fpselico" :class="item.oper.ico" :title="item.oper.name" @click="fpselBtnClick(item)"></i>
</el-form-item>
JS:
fncselvchange(item){
var _this = this;
var qs=require('qs');
item.options=[];
axios.post("/api/base/para/getParaListByCode", qs.stringify({
code:item.code,
token:this.$store.state.token.token
})).then(function (response) {
response.data.data.forEach((item1)=>{
item.options.push({
id:item1.id,
valStr:item1.valStr,
name:item1.name,
});
})
})
},
fpselpchange(item){
if(item.hasCasc==true){
var _this = this;
var qs=require('qs');
item.options=[];
axios.post("/api/base/para/getParaListByCode", qs.stringify({
code:item.code,
token:this.$store.state.token.token
})).then(function (response) {
response.data.data.forEach((item1)=>{
item.options.push({
id:item1.id,
valStr:item1.valStr,
name:item1.name,
paraInfo:item1.paraList[0]
});
})
})
}
},
- 关于elementui 中select选中值绑定为对象时
- 关于select设置动态值(自定义)为选中项
- 关于html中select选中的问题
- knockout select绑定,选中默认值
- Select 的绑定值为对象类型时用法 同时获取option选项的label和value值
- 关于select选中option时的方法
- js设置select列表中特定项为选中状态
- Jquery 获取select,option,radio选中对象与值(不断更新中)
- jQuery中获得选中select值
- jQuery中获得select选中的值
- select控件绑定数据,默认选中项
- JQuery__jquery控制select的text/value值为选中状态
- JQuery 设置select的Text值为***的选中
- select 动态查询时,设置某一项为默认选中
- 把<select>中option的转换为数组,并根据option text的值,设置选中,并刷新
- elementUI select 组件使用详解
- 关于select的清空,获取选中值
- jquery select 选中值
- 欢迎使用CSDN-markdown编辑器
- Percona Monitoring and Management 部署
- javaMelody监控javaWeb程序性能和jmeter压力测试
- vs2010编译带openssl 及zlib的curl库注意事项
- [内存管理] linux kernel内存映射实例分析
- 关于elementui 中select选中值绑定为对象时
- hbase查询条数和大小
- 使用BigDecimal进行精确运算
- sharding-jdbc 使用,进行分库分表以及多数据库间的事物验证
- 简单Excel导出功能
- 在一个非回文字符串后添加字符变成最短的回文字符串
- Axure草图事项
- 阿里成立达摩院,引入10位顶尖科学家3年投入预计超1000亿,马云提出4条期待(附:学术咨询委员会成员名单)
- activiti实战一(spring配置)