this.title = "编辑"; getAction(path.join(this.url.query, id)) .then(res => { this.form = res.data; }) .catch(err => { this.form = JSON.parse(JSON.stringify(this.defaultForm)); this.$message.warning("获取数据失败!"); }) .finally(() => { console.log("我是type"+this.form.content_type) if(this.form.content_type==2){ this.attr=1 }else{ this.attr=2 } console.log("我是attr"+this.attr) this.loading = false; }); },