前端开发一起交流QQ群:740034288。

互联网创业团队兴趣QQ群:792710437。

新建《团队合伙人》贴吧:https://tieba.baidu.com/f?kw=%E5%9B%A2%E9%98%9F%E5%90%88%E4%BC%99%E4%BA%BA&fr=index

1. weex下返回上一页:使用weex-vue-navigator插件。参考:https://github.com/MMF-FE/weex-vue-navigator。
    1.1 下载:npm i weex-vue-navigator --save-dev。
    1.2 在entry.js文件中配置引入:

const { router } = require('./router');
const App = require('@/index.vue');
import weexNavigator from 'weex-vue-navigator'
Vue.use(weexNavigator, {router})
new Vue(Vue.util.extend({el: '#root', router}, App));
router.push('/');
weexNavigator.bootstrap()

    1.3 在.vue文件中使用:
        this.$goTo(url)    //跳转指定页面。这个url是router里面配置的路由,如"/login",并自带动画效果。
        this.$back()  //返回上一页
        this.$goTo(url, true)

Logo

开源鸿蒙跨平台开发社区汇聚开发者与厂商,共建“一次开发,多端部署”的开源生态,致力于降低跨端开发门槛,推动万物智联创新。

更多推荐