mirror of
https://github.com/Powerful-517/yys-editor.git
synced 2026-03-05 15:05:27 +00:00
feat: 实现矢量节点 MVP 功能
- 扩展 NodeProperties 接口,添加 vector 字段定义 - 创建 VectorNode.vue 组件,使用 SVG Pattern 实现自动平铺 - 创建 VectorNodeModel.ts 数据模型,处理节点初始化和 resize - 创建 VectorPanel.vue 属性面板,支持图形类型、平铺尺寸、颜色等配置 - 在 FlowEditor.vue 中注册 vectorNode - 在 ComponentsPanel.vue 中添加到组件库 - 在 PropertyPanel.vue 中注册属性面板 功能特性: - 支持 5 种图形类型(矩形/椭圆/多边形/路径/自定义SVG) - 节点缩放时矢量图自动重复平铺 - 可调整平铺尺寸(10-500px) - 支持填充和描边颜色配置 - 实时预览,属性修改立即生效
This commit is contained in:
@@ -74,6 +74,8 @@ import ImageNode from './nodes/common/ImageNode.vue';
|
||||
import AssetSelectorNode from './nodes/common/AssetSelectorNode.vue';
|
||||
import TextNode from './nodes/common/TextNode.vue';
|
||||
import TextNodeModel from './nodes/common/TextNodeModel';
|
||||
import VectorNode from './nodes/common/VectorNode.vue';
|
||||
import VectorNodeModel from './nodes/common/VectorNodeModel';
|
||||
import PropertyPanel from './PropertyPanel.vue';
|
||||
import { useGlobalMessage } from '@/ts/useGlobalMessage';
|
||||
import { setLogicFlowInstance, destroyLogicFlowInstance } from '@/ts/useLogicFlow';
|
||||
@@ -669,6 +671,7 @@ function registerNodes(lfInstance: LogicFlow) {
|
||||
register({ type: 'imageNode', component: ImageNode }, lfInstance);
|
||||
register({ type: 'assetSelector', component: AssetSelectorNode }, lfInstance);
|
||||
register({ type: 'textNode', component: TextNode, model: TextNodeModel }, lfInstance);
|
||||
register({ type: 'vectorNode', component: VectorNode, model: VectorNodeModel }, lfInstance);
|
||||
}
|
||||
|
||||
// 初始化 LogicFlow
|
||||
|
||||
Reference in New Issue
Block a user