Bpmn.js 使用【问题?解决】

1,691 阅读1分钟

1. 元素属性创建/更新报错

vue3环境下 TypeError: 'get' on proxy: property 'labels' a read-only and non-configurable data property on the proxy target but the proxy did not return its actual value (expected '<Objec Array>' but got '[object Array]')

主要解决参考:github

扒遍全网,没一个说的明白的。😮‍💨

我的解决是:引入Modeler的文件,importXML时 modeler使用toRaw包一下。并且在使用modeling.updateProperties更新元素属性时,将this.element也使用toRaw包一下:toRaw(this.element)

// mixin文件中,更新元素属性
updateProperties(properties) {
     const modeling = toRaw(this.modeler).get("modeling");
     modeling.updateProperties(toRaw(this.element), properties);
}