How to use 3.9.8 mxgraph in vue.js

how to use the current mxgraph official website version of mxgraph,
1 in the vue project. Mxgraph, cannot be introduced in the .vue file according to the method given on the official website because there is a problem with the json profile path and file mismatch of the npm package.

2. After trying the method of introducing files through the < script > tag given on the official website, the method in vue.js will not be available.

3. Using import to introduce mxClient.js files will report a lot of errors.

beg the great god who has used mxgraph and the great god vue for guidance. How to use mxgraph correctly in vue projects

A lot of methods have been tried. Not a hand-holding party. Sincerely hope to solve the problem

Apr.30,2021

npm install mxgraph-js-- save

Vue

import {mxClient, mxUtils, mxEvent, mxGraph} 'mxgraph-js'
export default {
  data() {
    return {}
  },
  mounted() {
       if (!mxClient.isBrowserSupported()) {
        // Displays an error message if the browser is not supported.
        mxUtils.error('Browser is not supported!', 200, false);
      } else {
        mxEvent.disableContextMenu(document.body);
    
        // Creates the graph inside the given container
        var graph = new mxGraph(container);
        graph.graphHandler.scaleGrid = true;
        graph.setPanning(true);
    }
  }
}

has the landlord solved it? recently, I am also confused about mxgraph,


I would like to ask God, do you have any demo, or some resources summarized by yourself, can you show me? What I'm looking at here really blows my head off. Please show me a document or demo. Thank you. Thank you very much.

Menu