-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broken router generator #37
Comments
Ran into this today with a new cli build (per the README) using templates/simple.
I now have a functional web build after deleting src/router.js and applying this patch to the generated main.js file: --- a/src/main.js
+++ b/src/main.js
@@ -1,10 +1,12 @@
import Vue from 'vue'
import App from '~/App.vue'
+import router from './router'
import store from './store'
Vue.config.productionTip = false
new Vue({
+ router,
store,
render: (h) => h(App)
}).$mount('#app') With src/router.js gone, the import is now reading src/router.index.js, which has working logic (unmodified since installing this plugin). Then the patch above imports and passes to I did not have to change case of the |
I am facing the same problem for a new 'Dual' 'simple template' and 'history mode on' test project. Moving WARNING in ./main.native.js 42:13-20
"export 'options' was not found in './router/index.js'
@ multi ./main.native @rigor789 would that be possible that you share how you refactored |
Edit: I managed to make it work for Home and other routes, but not for About page. // ...
export const options = {
routes: routes
}
export default router I didn't change import { options } from './router/index.js' now the {
Home: {
component: {
name: 'home',
components: {
HelloWorld: {
name: 'HelloWorld',
props: {},
staticRenderFns: [],
_compiled: true,
__file: 'components/HelloWorld.native.vue'
}
},
staticRenderFns: [],
_compiled: true,
__file: 'views/Home.vue'
}
},
Terms: {
component: {
staticRenderFns: [],
_compiled: true,
__file: 'views/Terms.vue'
}
},
About: {}
} I also changed the routing as rigor789 suggested in <Button text="Home" @tap="goTo('Home')" row="0" />
<Button text="Terms" @tap="goTo('Terms')" row="1" /> Though routing to |
Looks like router generation is currently broken, the generated file (
src/router.ts
) contains the following:This is definitely not the desired result. A
router/index.ts
file is also generated, which looks correct for the most part, but theimport { options } from './router'
inmain.native.ts
no longer works.After manually refactoring
router/index
to export the routes, and updating theroutes.reduce
function inmain.native
the app builds, but seems like the default route names have changed from lowercase to titlecase sogoTo('home')
andgoTo('about')
no longer work unless we either change the route names, or update thegoTo
calls to use the correct casing (home -> Home, about -> About).Originally posted by @rigor789 in #35 (comment)
The text was updated successfully, but these errors were encountered: