一般我们修改弹窗时,我们修改回显状态,当时后端返回的一般都是0,1这些数组,这个时候我们就需要转成true或者false,开关才能有效
<el-switch v-model="status" active-color="#13ce66"></el-switch>
setDetail(row) {
this.imgLeft = row.static_pic;
this.fileListRig = [{ url: row.static_pic }];
this.fileListLeft = [{ url: row.dynamics_pic }];
this.formInline.price = row.price;
this.title_cn = row.title_cn;
this.title_vn = row.title_vn;
this.title_en = row.title_en;
this.formInline.scene_type = row.scene_type;
this.areas = row.areas;
this.has_sound = row.has_sound;
this.status = row.status == 1 ? true : false;
},
直接判断是否为1时显示不同的状态即可