Initial commit
This commit is contained in:
@@ -7,14 +7,21 @@
|
||||
* that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file is part of the kernelstudio package.
|
||||
*
|
||||
* (c) 2014-2025 zlin <admin@kernelstudio.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE file
|
||||
* that was distributed with this source code.
|
||||
*/
|
||||
import { register } from '@antv/x6-vue-shape';
|
||||
import ModelElement from './node.vue';
|
||||
import { createPorts } from './ports';
|
||||
|
||||
export const registerNodeElement = (type: string = 'task') => {
|
||||
export const registerNodeElement = () => {
|
||||
console.info('registerNodeElement');
|
||||
register({
|
||||
shape: type,
|
||||
shape: 'node',
|
||||
component: ModelElement,
|
||||
width: 120,
|
||||
attrs: {
|
||||
@@ -29,6 +36,14 @@ export const registerNodeElement = (type: string = 'task') => {
|
||||
dragging: {
|
||||
enabled: true,
|
||||
},
|
||||
ports: createPorts(),
|
||||
// 配置端口识别规则,
|
||||
portMarkup: [
|
||||
{
|
||||
tagName: 'div',
|
||||
selector: 'port-body',
|
||||
},
|
||||
],
|
||||
// 告诉 X6 如何识别 Vue 组件内的端口
|
||||
portAttribute: 'data-port',
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user