【问题标题】:Cannot add a null child view to a Viewgroup Nativescript-Vue无法将空子视图添加到视图组 Nativescript-Vue
【发布时间】:2019-05-31 20:15:13
【问题描述】:

我正在尝试将 vue-router 与 nativescript-vue 一起使用,但我收到错误 Cannot add a null child view to a Viewgroup

我按照 nativescript-vue 的文档,尝试将路由器放在外部文件中,但我得到了同样的错误。

import Vue from "nativescript-vue";
import VueDevtools from 'nativescript-vue-devtools';

Vue.use(VueDevtools, { host: '10.0.0.108' })

// import router from './router';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

import Home from '../components/Home';
import Login from '../components/Login';

const router = new VueRouter({
    pageRouting: true,
    routes: [
        { path: '/home', component: Home },
        { path: '/login', component: Login },
        { path: '*', redirect: '/home' },
    ],
});

router.replace('/home');

import store from './store';

// Uncommment the following to see NativeScript-Vue output logs
Vue.config.silent = false;

new Vue({
    router,
    store,
}).$start();

【问题讨论】:

    标签: vue.js nativescript nativescript-vue


    【解决方案1】:

    目前,不支持与 Vue Router 集成。在团队解决问题之前,请使用手动路由。

    来源:https://nativescript-vue.org/en/docs/routing/vue-router/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多