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

vue3按照官网给的例子,使用x6-vue-shape渲染节点,报错,使用的都是模板的代码 #3624

Closed
liuxiaokai666 opened this issue May 26, 2023 · 6 comments

Comments

@liuxiaokai666
Copy link

Describe the bug

报这个错::Uncaught TypeError: Cannot destructure property 'component' of 'shapeMaps[node.shape]' as it is undefined.,不知道怎么解决使用

Your Example Website or App

import Count from 'Count.vue' const graph = new Graph({ container: document.getElementById("app"), width: 600, height: 400, grid: true, }); Graph.registerNode("my-count", { inherit: "vue-shape", x: 200, y: 150, width: 150, height: 100, component: { template: <Count />, components: { Count, }, }, }); graph.addNode({ id: "1", shape: "my-count", x: 400, y: 150, width: 150, height: 100, data: { num: 0, }, });

Steps to Reproduce the Bug or Issue

报这个错::Uncaught TypeError: Cannot destructure property 'component' of 'shapeMaps[node.shape]' as it is undefined.

Expected behavior

初始化的时候,就直接无法初始化

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]
    x6使用的是2.11.1的版本
    x6-vue-shape使用的是2.0.11版本

Additional context

No response

@x6-bot
Copy link
Contributor

x6-bot bot commented May 26, 2023

👋 @liuxiaokai666

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.
We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@ainuo5213
Copy link

我也是这个问题,按照官方文档写的。但是就是报错

@lloydzhou
Copy link
Contributor

https://x6.antv.antgroup.com/tutorial/intermediate/vue
看一下,是不是按照2.x的文档写的?

@NewByVector
Copy link
Contributor

使用文档 上的方法来注册节点,而不是使用 registerNode.

@lily97
Copy link

lily97 commented Jan 9, 2024

import { register, getTeleport } from '@antv/x6-vue-shape'

register({
shape: 'custom-vue-node',
width: 100,
height: 100,
component: ProgressNode,
})
我的也是同样的问题,就是注册节点没成功,所以拖拽的时候也报错了,使用这个写法就能解决了!!!!!!

@x6-bot
Copy link
Contributor

x6-bot bot commented Jan 9, 2025

This thread has been automatically locked because it has not had recent activity.

Please open a new issue for related bugs and link to relevant comments in this thread.

@x6-bot x6-bot bot locked as resolved and limited conversation to collaborators Jan 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants