一·,
HTML
{ {item.developer_id}} { {item.developer_name}} { {item.developer_status==1?'正常':'锁定'}} { {item.operator}} { {item.operating_time}} { {item.developer_status==2?'启用':'禁用'}}
//弹框里面的内容布局确认
确认{
{ this.standardstu==2? '启用':'禁用'}}【{ { this.standardna}}】标准?
二,script
//主页面的script data(){ return { disable:false }},methods:{ closeen() { this.disable = false; }, sure() { this.disable = false; //这个接口为启用或者禁用成功改变状态 let _this = this; let checkInfo = {//给后台传入的参数}; checkInfo = this.qs.stringify(checkInfo); this.$axios.post('调用的接口',checkInfo,res =>{ this.getData(); //这个调用主页面的接口,即之后改变状态后的数据 this.checkedId = []; }) }, singleLock(id,stat,item){ this.standardna =item.developer_name; this.standardstu =stat; console.log(this.standardstu); if(this.standardstu == 1) { this.standardstu=="禁用" } else { this.standardstu=="启用" } this.disable = true; this.updateid=id; }}
//这个为子组件的script export default { name: 'enabled', data() { return { } }, props: ['standardna','standardstu'], mounted() { console.log(this.standardstu) }, methods: { closeen() { this.$emit('closeen'); }, sure() { this.$emit('sure'); } }, components: { } }
三,css
//子组件的css,样式较多可简化
-------END