Я создал новый проект Vue, используя vue / cli 3 : vue create hello-world
, затем я говорю да всем опциям, которые мне задавались.
Я хочу добавить префикс lang вкаждая роль маршрута.
Таким образом, единственный файл был изменен с router.ts
на в этом примере :
export default new Router({
mode: 'history',
base: process.env.BASE_URL,
routes: [
{
path: '/',
name: 'home',
component: Home
},
{
path: '/:lang',
component: {
template: '<router-view></router-view>'
},
children: [
{
path: 'about',
name: 'about',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
}
]
}
]
});
Но во время выполнения я получил ошибку:
[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.
found in
---> <Anonymous>
<App> at src/App.vue
<Root>
Что означает это сообщение об ошибке?И как это можно решить?