Я хочу использовать vue router в weex, но теперь возникла проблема: «Нет конфигурации компонента для name: router-view, использовать конфигурацию по умолчанию». Спасибо.
router.js
/*global Vue*/
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
Vue.use(Router)
module.exports = new Router({
routes: [
{
path: '/',
name: 'HelloWorld',
component: HelloWorld
}
]
})
HelloWorld.vue
<template>
<text class = "message">Now, let's use Vue.js to build your Weex app.</text>
</template>
index.vue
<template>
<div class = "wrapper">
<image :src = "logo" class = "logo" />
<text class = "greeting">The environment is ready!</text>
<router-view/>
</div>
</template>
@ittus, спасибо. Но я не знаю почему, vue-router не отображается в эмуляторе Xcode, но он работает на устройстве Android (реальной машине)。





Не используйте тег представления маршрутизатора как самозакрывающийся. Используйте его <router-view> </router-view>