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

Vue Router #31

Closed
genyx opened this Issue Oct 17, 2017 · 7 comments

Comments

Projects
None yet
2 participants
@genyx

genyx commented Oct 17, 2017

Can i use the vue-router for simply switching multiple pages/views?

@David-Desmaisons

This comment has been minimized.

Show comment
Hide comment
@David-Desmaisons

David-Desmaisons Oct 19, 2017

Member

Hello @genyx, it is currently not possible to use vue-router with Neutronium.

Indeed Neutronium is creating the root vue instance using corresponding viewmodel and vue-router implies that you create a vue instance using the router:

const router = new VueRouter({
  routes
})
const app = new Vue({
  router
}).$mount('#app')

This presents two chalenges: how to pass extra-data to the vue instance and how to allow alternative vue instanciation in Neutronium.
I will study further vue-router to see if I see a way to integrate.

You can also take a look at discussion of issue #26 that raise similar problems but offer alternative to vue-router.

Member

David-Desmaisons commented Oct 19, 2017

Hello @genyx, it is currently not possible to use vue-router with Neutronium.

Indeed Neutronium is creating the root vue instance using corresponding viewmodel and vue-router implies that you create a vue instance using the router:

const router = new VueRouter({
  routes
})
const app = new Vue({
  router
}).$mount('#app')

This presents two chalenges: how to pass extra-data to the vue instance and how to allow alternative vue instanciation in Neutronium.
I will study further vue-router to see if I see a way to integrate.

You can also take a look at discussion of issue #26 that raise similar problems but offer alternative to vue-router.

@David-Desmaisons

This comment has been minimized.

Show comment
Hide comment
@David-Desmaisons

David-Desmaisons Oct 26, 2017

Member

@genyx , in version 1.0.0, it will be possible to pass Vue instance option parameter. This means that it will be possible to use vue-router

To do so you need to export a vueInstanceOption function returning Vue instance option in the neutronium-vue install.js file

Example:

import VueRouter from 'vue-router'

function install(vue) {
    //Call vue use here if needed
    vue.use(VueRouter);
}

function vueInstanceOption() {
    const router= new VueRouter ({
    });
    //Return vue global option here, such as vue-router, vue-i18n, mix-ins, .... 
    return {router}
}

export {
    install,
    vueInstanceOption
} 

See documention

NB: I will release version 1.0.0 very shortly.

Member

David-Desmaisons commented Oct 26, 2017

@genyx , in version 1.0.0, it will be possible to pass Vue instance option parameter. This means that it will be possible to use vue-router

To do so you need to export a vueInstanceOption function returning Vue instance option in the neutronium-vue install.js file

Example:

import VueRouter from 'vue-router'

function install(vue) {
    //Call vue use here if needed
    vue.use(VueRouter);
}

function vueInstanceOption() {
    const router= new VueRouter ({
    });
    //Return vue global option here, such as vue-router, vue-i18n, mix-ins, .... 
    return {router}
}

export {
    install,
    vueInstanceOption
} 

See documention

NB: I will release version 1.0.0 very shortly.

@genyx

This comment has been minimized.

Show comment
Hide comment
@genyx

genyx Oct 26, 2017

Thanks man. But i probably will go with the dynamic components thing.

The 1.0.0 release will be on nuget? Asking because i currently use this repo self compiled. Nuget would be much easier.

genyx commented Oct 26, 2017

Thanks man. But i probably will go with the dynamic components thing.

The 1.0.0 release will be on nuget? Asking because i currently use this repo self compiled. Nuget would be much easier.

@David-Desmaisons

This comment has been minimized.

Show comment
Hide comment
@David-Desmaisons

David-Desmaisons Oct 26, 2017

Member

@genyx , It should be available very shortly, probably at the end of the week.

Member

David-Desmaisons commented Oct 26, 2017

@genyx , It should be available very shortly, probably at the end of the week.

@David-Desmaisons

This comment has been minimized.

Show comment
Hide comment
@David-Desmaisons

David-Desmaisons Oct 28, 2017

Member

@genyx , I just released version 1.0.0

Member

David-Desmaisons commented Oct 28, 2017

@genyx , I just released version 1.0.0

@David-Desmaisons

This comment has been minimized.

Show comment
Hide comment
@David-Desmaisons

David-Desmaisons Nov 11, 2017

Member

@genyx you can take a look at Neutronium.SPA.Demo.
It is a template project featuring routing, dependcy injection and integration with vue-router.
Soon I will add internalization, and in breve I will add diocumentation.

Member

David-Desmaisons commented Nov 11, 2017

@genyx you can take a look at Neutronium.SPA.Demo.
It is a template project featuring routing, dependcy injection and integration with vue-router.
Soon I will add internalization, and in breve I will add diocumentation.

@David-Desmaisons

This comment has been minimized.

Show comment
Hide comment
@David-Desmaisons

David-Desmaisons Nov 19, 2017

Member

@genyx , I am closing this one: Neutronium.SPA.Demo](https://github.com/NeutroniumCore/Neutronium.SPA.Demo) is a reference example of integration with vue-router. I am providing the complete documenattion.

Member

David-Desmaisons commented Nov 19, 2017

@genyx , I am closing this one: Neutronium.SPA.Demo](https://github.com/NeutroniumCore/Neutronium.SPA.Demo) is a reference example of integration with vue-router. I am providing the complete documenattion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment