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

请问在vue2 里使用 x6 vue-shape 2.0 的register函数注册VUE节点的话如何挂载ports 链接桩呢 #3003

Closed
AALiujiajun opened this issue Dec 5, 2022 · 14 comments
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions

Comments

@AALiujiajun
Copy link

问题描述

请问在vue2 里使用 x6 vue-shape 2.0 的register函数注册VUE节点的话如何挂载ports 链接桩呢

重现链接

x

重现步骤

1.3x

Graph.registerNode(
'dag-condition',
{
inherit: 'vue-shape',
component: xxx,
ports: {
// 链接桩
},
true
)

2.x

register({
shape: "normal-shape",
component: xxx
});

我该如何初始化链接桩

预期行为

注册VUE节点时可以初始化链接桩

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]
  • X6 版本: [1.28.2 ... ]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

@x6-bot
Copy link
Contributor

x6-bot bot commented Dec 5, 2022

👋 @AALiujiajun

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.

@NewByVector
Copy link
Contributor

同样是配置 ports 属性。

@NewByVector NewByVector added the type: discussion 讨论 Usage questions, guidance, and other discussions label Dec 5, 2022
@AALiujiajun
Copy link
Author

同样是配置 ports 属性。
大佬是这样子写嘛
register({
shape: "normal-shape",
component: xxx,
ports: { xxx }
});
不行耶 我看register.js 也是解构出了 shape, component, inherit 并没有地方传ports属性

@AALiujiajun AALiujiajun closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2022
@AALiujiajun AALiujiajun reopened this Dec 6, 2022
@NewByVector
Copy link
Contributor

@AALiujiajun 是那样写的,你可以把你的完整配置发出来看看。

@NewByVector
Copy link
Contributor

@AALiujiajun
Copy link
Author

好的 谢谢大佬

@menghaoG
Copy link

menghaoG commented Sep 7, 2023

我也遇到了同样的问题,请问该怎么解决,似乎连接桩没有初始化成功
image

@nanfb
Copy link

nanfb commented Oct 16, 2023

我也遇到了同样的问题,请问如何解决,好像连接桩没有初始化成功 图像

我也遇到了,你解决了吗?

@menghaoG
Copy link

我也遇到了同样的问题,请问如何解决,好像连接桩没有初始化成功 图像

我也遇到了,你解决了吗?

解决了,在使用vue组件时增加ports
register({
shape: 'er-table',
component: erTable,
ports: erTablePorts,
})
erTablePorts = {
groups: {
in: {
position: {
name: 'left',
args: {
strict: true,
dy: 18
}
},
attrs: {
circle: {
r: 4,
magnet: true,
stroke: '#409eff',
strokeWidth: 1,
fill: '#fff',
style: {
visibility: 'hidden',
},
},
},
},
out: {
position: {
name: 'right',
args: {
strict: true,
dy: 18
}
},
attrs: {
circle: {
r: 4,
magnet: true,
stroke: '#409eff',
strokeWidth: 1,
fill: '#fff',
style: {
visibility: 'hidden',
},
},
},
},
},
attrs: {
circle: {
r: 4,
magnet: true,
stroke: '#409eff',
strokeWidth: 1,
fill: '#fff',
style: {
visibility: 'hidden',
},
},
},
}

@nanfb
Copy link

nanfb commented Oct 16, 2023

我也遇到了同样的问题,请问如何解决,好像连接桩没有初始化成功 图像

我也遇到了,你解决了吗?

解决了,在使用vue组件时增加ports register({ shape: 'er-table', component: erTable, ports: erTablePorts, }) erTablePorts = { groups: { in: { position: { name: 'left', args: { strict: true, dy: 18 } }, attrs: { circle: { r: 4, magnet: true, stroke: '#409eff', strokeWidth: 1, fill: '#fff', style: { visibility: 'hidden', }, }, }, }, out: { position: { name: 'right', args: { strict: true, dy: 18 } }, attrs: { circle: { r: 4, magnet: true, stroke: '#409eff', strokeWidth: 1, fill: '#fff', style: { visibility: 'hidden', }, }, }, }, }, attrs: { circle: { r: 4, magnet: true, stroke: '#409eff', strokeWidth: 1, fill: '#fff', style: { visibility: 'hidden', }, }, }, }
并不行,我用的 register 这个函数,我看他的类型并没有ports这个参数,我想用Node.addPort添加节点也是失败

@menghaoG
Copy link

我也遇到了同样的问题,请问如何解决,好像连接桩没有初始化成功 图像

我也遇到了,你解决了吗?

解决了,在使用vue组件时增加ports
register({
shape: 'er-table',
component: erTable,
ports: erTablePorts,
})
erTablePorts = {
groups: {
in: {
position: {
name: 'left',
args: {
strict: true,
dy: 18
}
},
attrs: {
circle: {
r: 4,
magnet: true,
stroke: '#409eff',
strokeWidth: 1,
fill: '#fff',
style: {
visibility: 'hidden',
},
},
},
},
out: {
position: {
name: 'right',
args: {
strict: true,
dy: 18
}
},
attrs: {
circle: {
r: 4,
magnet: true,
stroke: '#409eff',
strokeWidth: 1,
fill: '#fff',
style: {
visibility: 'hidden',
},
},
},
},
},
attrs: {
circle: {
r: 4,
magnet: true,
stroke: '#409eff',
strokeWidth: 1,
fill: '#fff',
style: {
visibility: 'hidden',
},
},
},
}

我也遇到了同样的问题,请问如何解决,好像连接桩没有初始化成功 图像

我也遇到了,你解决了吗?

解决了,在使用vue组件时增加ports register({ shape: 'er-table', component: erTable, ports: erTablePorts, }) erTablePorts = { groups: { in: { position: { name: 'left', args: { strict: true, dy: 18 } }, attrs: { circle: { r: 4, magnet: true, stroke: '#409eff', strokeWidth: 1, fill: '#fff', style: { visibility: 'hidden', }, }, }, }, out: { position: { name: 'right', args: { strict: true, dy: 18 } }, attrs: { circle: { r: 4, magnet: true, stroke: '#409eff', strokeWidth: 1, fill: '#fff', style: { visibility: 'hidden', }, }, }, }, }, attrs: { circle: { r: 4, magnet: true, stroke: '#409eff', strokeWidth: 1, fill: '#fff', style: { visibility: 'hidden', }, }, }, }
并不行,我用的 register 这个函数,我看他的类型并没有ports这个参数,我想用Node.addPort添加节点也是失败

register这个函数是有ports这个参数的,在Node.Properties
image
也有可能是版本问题,我用的是2.13.1

@nanfb
Copy link

nanfb commented Oct 16, 2023

我也遇到了同样的问题,请问如何解决,好像连接桩没有初始化成功 图像

我也遇到了,你解决了吗?

解决了,在使用vue组件时增加ports register({ shape: 'er-table', component: erTable, ports: erTablePorts, }) erTablePorts = { groups: { in: { position: { name: 'left', args: { strict: true, dy: 18 } }, attrs: { circle: { r: 4, magnet: true, stroke: '#409eff', strokeWidth: 1, fill: '#fff', style: { visibility: 'hidden', }, }, }, }, out: { position: { name: 'right', args: { strict: true, dy: 18 } }, attrs: { circle: { r: 4, magnet: true, stroke: '#409eff', strokeWidth: 1, fill: '#fff', style: { visibility: 'hidden', }, }, }, }, }, attrs: { circle: { r: 4, magnet: true, stroke: '#409eff', strokeWidth: 1, fill: '#fff', style: { visibility: 'hidden', }, }, }, }

我也遇到了同样的问题,请问如何解决,好像连接桩没有初始化成功 图像

我也遇到了,你解决了吗?

解决了,在使用vue组件时增加ports register({ shape: 'er-table', component: erTable, ports: erTablePorts, }) erTablePorts = { groups: { in: { position: { name: 'left', args: { strict: true, dy: 18 } }, attrs: { circle: { r: 4, magnet: true, stroke: '#409eff', strokeWidth: 1, fill: '#fff', style: { visibility: 'hidden', }, }, }, }, out: { position: { name: 'right', args: { strict: true, dy: 18 } }, attrs: { circle: { r: 4, magnet: true, stroke: '#409eff', strokeWidth: 1, fill: '#fff', style: { visibility: 'hidden', }, }, }, }, }, attrs: { circle: { r: 4, magnet: true, stroke: '#409eff', strokeWidth: 1, fill: '#fff', style: { visibility: 'hidden', }, }, }, }
并不行,我用的 register 这个函数,我看他的类型并没有ports这个参数,我想用Node.addPort添加节点也是失败

register这个函数是有ports这个参数的,在Node.Properties image 也有可能是版本问题,我用的是2.13.1

image
image
我这样写的,我感觉没啥问题啊,我的版本也是2.x,佬,可以康康😥

@AALiujiajun
Copy link
Author

我也遇到了同样的问题,请问如何解决,好像连接桩没有初始化成功 图像

我也遇到了,你解决了吗?

解决了,在使用vue组件时增加ports register({ shape: 'er-table', component: erTable, ports: erTablePorts, }) erTablePorts = { groups: { in: { position: { name: 'left', args: { strict: true, dy: 18 } }, attrs: { circle: { r: 4, magnet: true, stroke: '#409eff', strokeWidth: 1, fill: '#fff', style: { visibility: 'hidden', }, }, }, }, out: { position: { name: 'right', args: { strict: true, dy: 18 } }, attrs: { circle: { r: 4, magnet: true, stroke: '#409eff', strokeWidth: 1, fill: '#fff', style: { visibility: 'hidden', }, }, }, }, }, attrs: { circle: { r: 4, magnet: true, stroke: '#409eff', strokeWidth: 1, fill: '#fff', style: { visibility: 'hidden', }, }, }, }

我也遇到了同样的问题,请问如何解决,好像连接桩没有初始化成功 图像

我也遇到了,你解决了吗?

解决了,在使用vue组件时增加ports register({ shape: 'er-table', component: erTable, ports: erTablePorts, }) erTablePorts = { groups: { in: { position: { name: 'left', args: { strict: true, dy: 18 } }, attrs: { circle: { r: 4, magnet: true, stroke: '#409eff', strokeWidth: 1, fill: '#fff', style: { visibility: 'hidden', }, }, }, }, out: { position: { name: 'right', args: { strict: true, dy: 18 } }, attrs: { circle: { r: 4, magnet: true, stroke: '#409eff', strokeWidth: 1, fill: '#fff', style: { visibility: 'hidden', }, }, }, }, }, attrs: { circle: { r: 4, magnet: true, stroke: '#409eff', strokeWidth: 1, fill: '#fff', style: { visibility: 'hidden', }, }, }, }
并不行,我用的 register 这个函数,我看他的类型并没有ports这个参数,我想用Node.addPort添加节点也是失败

register这个函数是有ports这个参数的,在Node.Properties image 也有可能是版本问题,我用的是2.13.1

image image 我这样写的,我感觉没啥问题啊,我的版本也是2.x,佬,可以康康😥

import { register } from "@antv/x6-vue-shape";

export const ports = {
groups: {
...defaultPortAttrs
},
items: [
{
group: "top",
},
{
group: "bottom",
},
],
};

register({
shape: "ftp-datasource",
width: 150,
height: 36,
component: ftpDatasource,
ports: ports,
});

找不到也直接写 注册出来就有了

@x6-bot
Copy link
Contributor

x6-bot bot commented Oct 16, 2024

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 Oct 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions
Projects
None yet
Development

No branches or pull requests

4 participants