If you are using the runtime-only
build, it seems like you will need to either provide a render function or incorporate the standalone build
. At this stage, I assume you are in the process of setting everything up, so the next step would be to determine how you plan to structure your application.
In case you opt for blade
templating, you must utilize the standalone build
. Simply add an alias in your webpack config
to include it (refer to: https://github.com/JeffreyWay/laravel-elixir-webpack-official):
resolve: {
alias: {
'vue$': 'vue/dist/vue.common.js'
}
}
Alternatively, if you are working with browserify
, make sure to update your package.json
as follows:
"browser": {
"vue": "vue/dist/vue.common"
}
Laravel 5.4
includes this functionality by default (using Laravel mix
), but it appears that version 5.3
does not offer it.
For those interested in utilizing .vue
files to build a Single Page Application (SPA), the runtime-only
build can be used along with creating an App.vue
file containing your layout and mounting it accordingly:
var Vue = require('vue');
var App = require('./components/App.vue');
const app = new Vue({
render: h => h(App)
}).$mount('#app');
If you want more insights on taking this path, refer to the following answer: Updating elements outside of a component