Skip to content

weex-vue-navigator makes weex able to use SPA at web side, and use multi-page jumping at native side

License

Notifications You must be signed in to change notification settings

MMF-FE/weex-vue-navigator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

weex-vue-navigator

weex-vue-navigator makes weex able to use SPA at web side, and use multi-page jumping at native side

Install

npm i weex-vue-navigator --save-dev
# or
yarn add weex-vue-navigator --dev

Configuration

import Vue from 'vue'
import Router from 'vue-router'
import weexNavigator from 'weex-vue-navigator'
import App from '{YouAppPath}.vue'

Vue.use(Router)

let router = new Router({
    // you config
})

Vue.use(weexNavigator, {router})

new Vue({
    el: '#root',
    router,
    render: h => h(App),
})

weexNavigator.bootstrap()

Usage

export default {
    methods: {
        jump(url) {
            this.$goTo(url)
        },
        back() {
            this.$back()
        },
        jumpOnSelf(url) {
            this.$goTo(url, true)
        }
    }
}

Vue.prototype.$goTo (url:string, isSelf:boolean = false)

  • url: vue route url
  • isSelf: open on self view (use tab change)

Vue.prototype.$back ()

About

weex-vue-navigator makes weex able to use SPA at web side, and use multi-page jumping at native side

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published