Skip to content
New issue

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

vue render #3

Closed
lloydzhou opened this issue Apr 12, 2023 · 0 comments · Fixed by #4
Closed

vue render #3

lloydzhou opened this issue Apr 12, 2023 · 0 comments · Fixed by #4

Comments

@lloydzhou
Copy link
Owner

lloydzhou commented Apr 12, 2023

封装vue render

import createRender from "x6-html-shape/dist/vue";
import createRender from "x6-html-shape/dist/vue2";
const render = createRender(CustomComponent);
// 选择性使用vue3/vue2

// 或者直接使用teleport进行渲染
import createTeleportRender from "x6-html-shape/dist/teleport";
const [render, Container] = createTeleportRender(CustomComponent);

// 如果使用teleport进行渲染,需要先挂载对应的Container
<Container />

// 注册节点
register({
  shape: "html-shape-for-vue",
  render: render,
  width: 200,
  height: 40
});

// 创建节点
graph.addNode({
  shape: 'html-shape-for-vue-teleport',
  id: 'node1',
  label: 'node1',
  x: 100,
  y: 100,
})
@lloydzhou lloydzhou pinned this issue Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant