This commit is contained in:
shidongli 2024-07-12 15:48:08 +08:00
parent b73cb7ea07
commit 05ee30c39a

View File

@ -21,15 +21,20 @@ export default {
const page = this.editor.getCurrentPage(); const page = this.editor.getCurrentPage();
// 获取所选对象 // 获取所选对象
const selectedItem = page.getSelected()[0]; const selectedItem = page.getSelected()[0];
console.log(this.edgeAttributeForm);
if(this.edgeAttributeForm.keyword){ let newObj = JSON.parse(JSON.stringify(this.edgeAttributeForm))
this.edgeAttributeForm.label = { if(newObj.keyword){
text: this.edgeAttributeForm.label, newObj.label = {
text: newObj.label,
fill: 'red' fill: 'red'
} }
// this.edgeAttributeForm.label = {
// text: this.edgeAttributeForm.label,
// fill: 'red'
// }
} }
page.update(selectedItem.id, { page.update(selectedItem.id, {
label: this.edgeAttributeForm.label, label: newObj.label,
shape: this.edgeAttributeForm.shape, shape: this.edgeAttributeForm.shape,
keyword: this.edgeAttributeForm.keyword keyword: this.edgeAttributeForm.keyword
}); });