-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Can't get router to work with components in Runtime mode #824
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
Comments
Hi, thanks for filling this issue.
You need standalone build for this.
No it's not. Runtime only build can only handle render functions, anything other than that (template string, in-dom templates) are not supported. |
@fnlctrl If I am looking at the generated js file, I am seeing the render function, as created by Webpack. Isn't this the render function you are mentioning? |
Yes. Then there may be some other things wrong here.. Need a reproduction repo to look into. |
If the template is on the index.html I doubt I'ts parsed by vue-loader. You should bundle that template into an App.vue component then use it in main.js like this: import App from './App.vue'
new Vue({
router,
el: '#app', // equivalent to mount
render: h => h(App)
}) |
Closing due to inactivity. |
I created a default webpack project with vue-cli, and changed the main.js file to match the example here: https://github.com/vuejs/vue-router/blob/next/examples/basic/app.js
With one difference though. I removed the "template" part in the code. I now expect it to render the component in the "el", since the template is already parsed into the main bundle js.
The text was updated successfully, but these errors were encountered: