antvis/G6
Do you want to work on this issue?
You can request for a bounty in order to promote it!
[Bug]: Node-style-component can't be used in vue to define components, can only be used in jsx? #6720
21236774 posted onGitHub
Describe the bug / 问题描述
vue中怎么使用自定义dom,目前项目不是在react项目 配置项:
{
node: {
type: 'rect',
style: (d) => {
return {
radius: 10,
size: [106, 58],
component: Node(d)
}
},
state: {
selected: {
labelFontWeight: 'normal',
lineWidth: 0,
halo: false
}
}
}
}
Node函数
const Node = (data) => {
const { name } = data
const containerStyle = {
width: '100%',
height: '100%',
border: `3px solid #fff`,
borderRadius: 16,
cursor: 'pointer'
}
return h('div', { style: containerStyle }, name)
}
Reproduction link / 复现链接
暂无
Steps to Reproduce the Bug or Issue / 重现步骤
No response
G6 Version / G6 版本
🆕 5.x
OS / 操作系统
- macOS
- Windows
- Linux
- Others / 其他
Browser / 浏览器
- Chrome
- Edge
- Firefox
- Safari (Limited support / 有限支持)
- IE (Nonsupport / 不支持)
- Others / 其他