Release 6.70.0
In release 6.70.0 we've updated our Vue 3 integration to make it more modern and easier to use, with reduced boilerplate and better documentation.
It is now optional to set surfaceId on the SurfaceComponent, MiniviewComponent, ControlsComponent, ExportControlsComponent and ShapePaletteComponent - the components will use a default value if not provided.
With these changes you can now get up and running with JsPlumb Vue quicker than ever:
<template>
<div style="width:100%;height:100%">
<SurfaceComponent :data="this.getData()"/>
<ControlsComponent/>
<MiniviewComponent/>
</div>
</template>
<script>
import { defineComponent } from "vue"
export default defineComponent({
methods:{
getData:function() {
return {
data:{
nodes:[
{ id:"1", label:"1", left:50, top:50},
{ id:"2", label:"TWO", left:250, top:250}
],
edges:[
{ source:"1", target:"2" }
]
}
}
}
}
})
</script>
We've also made a bunch of other nice changes in this release. The full changelog is:
Updates
-
None of the Vue 3 components require a
surface-idprop anymore. For the vast majority of apps, having a single surface, that means you can rely on the defaults and remove a bunch of boilerplate from your templates. -
If you do not provide a component to map a node or a group, the Vue 3 integration will now use a default component.
-
Vue 3's
loadSurfacemethod now makes surfaceId optional: if you omit it, JsPlumb will use the default surface id. -
We've added a
ControlsComponentto our Vue 3 integration -
We've added an
ExportControlsComponentto our Vue 3 integration -
We've added an
ExportControlsComponentto our React integration -
Our Vue 3 docs have been updated to be easier to follow and to find the things you need.
-
The
ControlsComponentin the React integration was updated to honour an orientation prop set on it. -
You can pass an optional
typeParameterand/orcategoryParameterto the constructor of ShapeLibraryImpl. This allows you to override the parameters the shape library will use from each vertex's data to resolve the shape to use.
Breaking changes
A few components were renamed in the Vue 3 integration:
jsplumb-toolkitis nowSurfaceComponentjsplumb-miniviewis nowMiniviewComponentjsplumb-shapeis nowShapeComponentjsplumb-shape-paletteis nowShapePaletteComponentjsplumb-edge-type-pickeris nowEdgeTypePicker
In the Vue 3 SurfaceComponent:
renderParamswas renamed torenderOptionsviewwas renamed toviewOptionstoolkitParamswas renamed totoolkitOptions
Further reading
- Read about JsPlumb's comprehensive Vue 3 integration here: https://vue.jsplumbtoolkit.com/
Start a free trial
Get in touch!
If you'd like to discuss any of the ideas/concepts in this article we'd love to hear from you - drop us a line at hello@jsplumbtoolkit.com.