We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The text was updated successfully, but these errors were encountered:
在自定义model的时候,如果直接通过this.properties在model中获取properties属性,会显示为Proxy对象。这是因为LogicFlow内部为了让properties发生变化后能实时更新流程图,所以把properties转换为响应式对象。如果要打印原生对象内容,可以使用model的getProperties方法获取。
this.properties
class UserTaskModel extends RectNodeModel { getNodeStyle() { const style = super.getNodeStyle(); const properties = this.getProperties(); if (properties.statu === 'pass') { style.stroke = "green"; } else if (properties.statu === 'reject') { style.stroke = "red"; } else { style.stroke = "rgb(24, 125, 255)"; } return style; } }
PS: proxy对象虽然打印出来无法看到属性,但是在控制台上继续展开也可以看到属性。同时,这些属性可以仍然可以正常的通过属性操作符得到。上面的代码和下面的结果一致:
class UserTaskModel extends RectNodeModel { getNodeStyle() { const style = super.getNodeStyle(); if (this.properties.statu === 'pass') { style.stroke = "green"; } else if (this.properties.statu === 'reject') { style.stroke = "red"; } else { style.stroke = "rgb(24, 125, 255)"; } return style; } }
Sorry, something went wrong.
statu这个属性是写在哪里的?
No branches or pull requests
The text was updated successfully, but these errors were encountered: