Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 940 Bytes

README.md

File metadata and controls

39 lines (30 loc) · 940 Bytes

vue-mxgraph-samples

在 vue2 中使用 mxgraph 的一些用例 / used mxgraph in vue2

核心文件

用于封装 mxgraph 的核心文件 vue-mxgraph/src/assets/mxgraph/4.0.0/mxgraph.js

let mxgraphFactory = require('mxgraph')

const factory = new mxgraphFactory({
  mxImageBasePath: 'assets/mxgraph/4.0.0/images',
  mxBasePath: 'assets/mxgraph/4.0.0'
})

module.exports = factory

在 vue 中引用的方法如下

import {
  mxClient,
  mxUtils,
  mxEvent,
  mxGraph,
  mxConstants,
  mxRubberband
} from '@/assets/mxgraph/4.0.0/mxgraph'

样例:

vue-mxgraph/src/views/Graph.js

参考:

jgraph/mxgraph/issues/175/npm install

Editor doesn't created when mxGraph is used as npm module

Demo

demo