Answer the question
In order to leave comments, you need to log in
Why doesn't vue2 work in latest Laravel?
I put the latest build of laravel. I already understood it as it is imprisoned for vue3. I put my project on vue2 and I get an error in the browser console:
undefined is not an object (evaluating 'Vue.version.split')
mix.js('vendor/vkiranananda/backend/resources/js/backend.js', 'public/backend/js/admin.js').vue({ version: 2 }).version();
Answer the question
In order to leave comments, you need to log in
You need to manually import into the Vue entry point:
// src/app.js
import Vue from 'vue'; //////// <---
import Alert from './Alert.vue';
new Vue({
el: '#app',
components: { Alert }
});
You need to import in the Vue component:
// src/app.js
import Vue from 'vue';
import Alert from './Alert.vue';
new Vue({
el: '#app',
components: { Alert }
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question