0.3.3 • Published 5 years ago

rete-vue-render-plugin2 v0.3.3

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

Vue Render

Rete.js plugin

import VueRenderPlugin from 'rete-vue-render-plugin';

editor.use(VueRenderPlugin);
import CustomNodeComponent from './CustomNodeComponent.vue';
import CustomControlComponent from './CustomControlComponent.vue';

class MyComponent extends Rete.Component {
    constructor(){
        // ...
        this.data.render = 'vue';
        this.data.component = CustomNodeComponent; // Vue.js component, not required
        this.data.props = {}; // props for the component above, not required
    }
}

class MyControl extends Rete.Control {
    constructor(){
        // ...
        this.data.render = 'vue';
        this.data.component = CustomControlComponent; // Vue.js component, required
        this.data.props = {}; // props for the component above, not required
    }
}
const node = editor.nodes[0];
const control = node.controls.get('ctrl');

node.update(); // force update
control.update(); // of view

// in some cases you can gt Vue.js context
node.vueContext
control.vueContext