Skip to content

Add support for Vue plugins #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cvisl opened this issue Sep 23, 2019 · 6 comments
Closed

Add support for Vue plugins #17

cvisl opened this issue Sep 23, 2019 · 6 comments
Labels
enhancement New feature or request

Comments

@cvisl
Copy link

cvisl commented Sep 23, 2019

Now all the components within retejs vue-render-plugin are rendered separately as their own vue instances. This disables the option to have a global Vuex store for example, maybe for now it can be imported per component, I don't know.

It would be useful in general to be able to globally define the Vue plugins in the options for example to use them over all components created throughout rete.

@Ni55aN Ni55aN added the enhancement New feature or request label Sep 26, 2019
@Ni55aN
Copy link
Member

Ni55aN commented Sep 26, 2019

v0.5.0

editor.use(VueRenderPlugin, {
    options: {
        // router, plugin, etc.
    }
});

@mstrouhal
Copy link

It is working great now, thank you!

@Ni55aN Ni55aN closed this as completed Oct 1, 2019
@Relatora
Copy link

can you please point me out to a working example. I'm new to Vue and would like to use Retejs for a project.

@Ni55aN
Copy link
Member

Ni55aN commented Oct 23, 2019

@Relatora do you want to integrate this into an existing project or create a new one?

@Relatora
Copy link

I'm creating a new project

@cvisl
Copy link
Author

cvisl commented Oct 28, 2019

@Relatora For me its working now and I am using it like this:

Define the store in e.g. ./store/index.ts.

import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    plugins: [],
    modules:{
    },
    state:{
    },
    mutations: {
    },
    actions: {
    },
    strict: false
})

And where ever you define the vuerenderplugin import it into Rete.js like this:

import store from '../store'

this.editor.use(VueRenderPlugin, {
        options: {
            store
        }
      });

Hope this is of some help to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants