I am working on the integration of @jsplumb/browser-ui
community edition into my application. After receiving a recommendation from the team at jsplumb
, I decided to utilize @jsplumb/browser-ui
. However, I am facing difficulty in understanding how to begin integrating it into my Vue/Nuxtjs application
.
Here are the steps I have been following:
- Install
@jsplumb/browser-ui
using
.npm install @jsplumb/browser-ui --save
- Add the libraries to the
nuxt-config.js
under thescript
section:
script: [
{
src:"node_modules/@jsplumb/core/js/jsplumb.core.umd.js",
mode: 'client'
},
{
src:"node_modules/@jsplumb/browser-ui/js/jsplumb.browser-ui.umd.js",
mode: 'client'
}
]
- The code snippet I have so far is:
<template>
<div class="row">
<div class="col-md-12">
<div id="diagram" style="position: relative" />
</div>
</div>
</template>
<script>
if (process.browser) {
const jsPlumbBrowserUI = require('node_modules/@jsplumb/browser-ui/js/jsplumb.browser-ui.umd.js')
const instance = jsPlumbBrowserUI.newInstance({
container: document.getElementById('diagram')
})
console.log(instance)
}
export default {
mounted () {
if (process.browser) {
console.log('MOUNTED BLOCK')
}
}
}
</script>
I am encountering difficulties in the integration process within my application. The available documentation does not present a comprehensive example specific to Vue/Nuxtjs