I am facing an error trying to use Vuejs 2 + Vue Router 2 + Laravel 5.3 with webpack!
There is my code:
My index.html
<div id="app">
<router-view></router-view>
</div>
My app.js
import Vue from 'vue'
import VueRouter from 'vue-router'
import App from './App.vue'
import Map from './map'
Vue.use(VueRouter);
const router = new VueRouter({
routes: Map
});
new Vue({
router,
render: h => {
return h(App)
}
}).$mount('#app');
My App.vue
<template>
<router-view></router-view>
</template>
<script>
export default {
name: 'App',
}
</script>
With this a have the following error:
You are using the runtime-only build of Vue where the template option is not available. Either pre-compile the templates into render functions, or use the compiler-included build.
If I change my Vue import from:
import Vue from 'vue'
to
import Vue from 'vue/dist/vue.js'
it works fine!
Somebody know how to fix it?