html
<el-dialog :title="showTitle" :visible="showDialog" @close="close"> </el-dialog>
使用计算属性
javascript
computed: {
showTitle() {
//这里根据点击的是否有具体点击的那个id来判断
return this.form.id ? "编辑部门" : "新增部门";
},
},
