Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

@antv/x6 基于 vue2 + composition-api 的图形化编辑器

License

NotificationsYou must be signed in to change notification settings

g0ngjie/antv-x6-vue2

Repository files navigation

@antv/x6 基于 vue2 + composition-api 的图形化编辑器

antv-x6-vue2

支持触控屏版:在线访问

在线访问

  • 画布自适应
  • 快捷键
  • 工具栏 组合按键功能
  • 事件监听
  • vue 自定义组件

使用

main.js

importVuefrom"vue";importantvfrom"antv-x6-vue2";import"antv-x6-vue2/lib/antv.css";Vue.use(antv);

vue2 文件中使用

<template>  <div>    <antv-x6-vue2></antv-x6-vue2>  </div></template>

Api

说明函数
初始化画布默认数据initDefaultData(nodes: any[], edges: any[]): void
获取数据exportData(): { nodes: string[], edges: string[], nodesJSON: any[], edgesJSON: any[] }
画布只读onlyLook(bool: boolean): void
画布清空clean(): void
修改 Node 节点文案updateLabel(label: string): void
监听单元事件双击回调GraphListener.doubleNodeClick(cb: ICallbackFunc): void
监听单元事件单击回调GraphListener.nodeClick(cb: ICallbackFunc): void
运行时异常监听GraphListener.runtimeError(cb: IErrorCallbackFunc): void
图形校验函数graphValidate(): { ok: boolean, errs: string[] }
获取所有已存在的 node 节点和 edge 边getAtoms(options?: 'nodes' | 'edges'): { nodes: ...[], edges: ...[] } | undefined

Events

组件事件

事件名说明参数
node-clickNode 节点被点击时会触发该事件{ nodeId, actionType, label, node }
node-dblclickNode 节点被双击时会触发该事件{ nodeId, actionType, label, node }
import{graphFunc}from"antv-x6-vue2";graphFunc.GraphListener.doubleNodeClick((detail)=>{const{ nodeId, label, actionType}=detail;});

异常类

错误码(errorCode)说明(errorMsg)
2000非法参数
2001验证失败
2002数据格式不正确
import{graphFunc}from"bt-antv-x6";graphFunc.GraphListener.runtimeError((err)=>{const{ errorCode, errorMsg}=err;});

About

@antv/x6 基于 vue2 + composition-api 的图形化编辑器

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp