- npm 引入
import GoJsDesigner from 'gojs-flow-designer'
import 'gojs-flow-designer/lib/gojs-designer.css';
<GoJsDesigner
:preview="preview"
@nodeOnClick="nodeOnClick"
:data="data"
ref="designer"
>
</GoJsDesigner>
- 浏览器引入
<script src="https://unpkg.com/gojs-flow-designer"></script>
<link href="https://unpkg.com/gojs-flow-designer/lib/gojs-designer.css" />
<go-js-designer
:preview="preview"
@nodeOnClick="nodeOnClick"
:data="data"
ref="designer"
>
</go-js-designer>
-
data: Object // 流程图 json
-
preview: boolean // 是否为预览模式
- nodeOnClick: (node) => {} // 返回 node 节点信息
- getJSON
// 获取流程json
this.$refs.designer.getJSON();
- redraw
// 重新渲染
this.$refs.designer.redraw();