У меня есть простой компонент задач, работающий нормально, я хотел добавить функциональность нумерации страниц, поэтому добавил следующую строку
Vue.component ('pagination', require ('laravel-vue-pagination'));
Uncaught ReferenceError: Vue не определено
даже в моем app.js vue импортируется вот так
window.Vue = require('vue');
Мой компонент задачи js code
Vue.component('pagination', require('laravel-vue-pagination'));
export default {
data() {
return {
tasks: {},
}
},
methods: {
// Our method to GET results from a Laravel endpoint
// getResults(page = 1) {
// axios.get('http://laravel.vue.com/tasks?page=' + page)
// .then((response) => this.tasks = response.data)
// .catch((error) => console.log(error));
// }
},
mounted() {
console.log('Component Mounted.')
},
created() {
console.log('Tasks Component Loaded.');
//console.log(this.tasks);
axios.get('http://laravel.vue.com/tasks')
.then((response) => this.tasks = response.data)
// .then((response) => console.log(response.data))
.catch((error) => console.log(error));
},
}