Skip to content

Commit

Permalink
feat: [x6-vue-shape] Pass the value directly instead of the function
Browse files Browse the repository at this point in the history
feat: [x6-vue-shape] Pass the value directly instead of the function
  • Loading branch information
gxy5202 authored Jul 11, 2023
1 parent c03138c commit 1916e70
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/x6-vue-shape/src/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,17 @@ export class VueShapeView extends NodeView<VueShape> {
if (root) {
const { component } = shapeMaps[node.shape]
if (component) {
const getNode = () => node
const getGraph = () => graph
if (isVue2) {
const Vue = Vue2 as any
this.vm = new Vue({
el: root,
render(h: any) {
return h(component, { getNode, getGraph })
return h(component, { node, graph })
},
provide() {
return {
getNode,
getGraph,
getNode: () => node,
getGraph: () => graph,
}
},
})
Expand All @@ -53,12 +51,12 @@ export class VueShapeView extends NodeView<VueShape> {
} else {
this.vm = createApp({
render() {
return h(component, { getNode, getGraph })
return h(component, { node, graph })
},
provide() {
return {
getNode,
getGraph,
getNode: () => node,
getGraph: () => graph,
}
},
})
Expand Down

0 comments on commit 1916e70

Please sign in to comment.