-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
Description
发生了什么?
问题:
渲染时报错,但是渲染正常

错误代码:
这样写,Vue2 会把 node 和 graph 当作 HTML 属性(attrs) 传下去,而不是 props。自定义组件接收不到。
// view.js
if (isVue2) {
const Vue = Vue2 as any
const Composed = wrapWithContainer(component)
this.vm = new Vue({
el: root,
render(h: any) {
return h(Composed, {
node: model, // ← 这里
graph: graphModel, // ← 这里
})
},
})
}正确代码:
// view.js
if (isVue2) {
const Vue = Vue2 as any
const Composed = wrapWithContainer(component)
this.vm = new Vue({
el: root,
render(h: any) {
return h(Composed, {
props: { // ← 改成这样,显式用 props 对象
node: model,
graph: graphModel,
}
})
},
})
}logicflow/core版本
2.2.0-alpha.3
logicflow/extension版本
2.2.0-alpha.3
logicflow/engine版本
No response
浏览器&环境
Chrome
Reactions are currently unavailable