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 selectedItem = page.getSelected()[0];
console.log(this.edgeAttributeForm);
if(this.edgeAttributeForm.keyword){
this.edgeAttributeForm.label = {
text: this.edgeAttributeForm.label,
let newObj = JSON.parse(JSON.stringify(this.edgeAttributeForm))
if(newObj.keyword){
newObj.label = {
text: newObj.label,
fill: 'red'
}
// this.edgeAttributeForm.label = {
// text: this.edgeAttributeForm.label,
// fill: 'red'
// }
}
page.update(selectedItem.id, {
label: this.edgeAttributeForm.label,
label: newObj.label,
shape: this.edgeAttributeForm.shape,
keyword: this.edgeAttributeForm.keyword
});