Skip to content

Commit a2ac37b

Browse files
author
ahmadhuss
committed
refactor: Updated resources/js/app.js file
1 parent 6f0ba85 commit a2ac37b

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

resources/js/app.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
1-
//import vue
21
import Vue from 'vue';
2+
import axios from 'axios';
33
import _ from 'lodash';
44

5-
Vue.prototype._ = _;
5+
/**
6+
* We'll load the axios HTTP library which allows us to easily issue requests
7+
* to our Laravel back-end. This library automatically handles sending the
8+
* CSRF token as a header based on the value of the "XSRF" token cookie.
9+
*/
10+
11+
window.axios = axios;
12+
13+
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
614

15+
16+
window.Vue = Vue;
17+
// Do `Vue.prototype._` = _ to use lodash as _ in templates. But I recommend you to define
18+
// your own filters/methods that use lodash methods instead
19+
Vue.prototype._ = _;
720
// id app
821
Vue.component('front-page', require('./components/Front.vue').default);
9-
22+
// Load third party vue component `laravel-vue-pagination`
23+
Vue.component('pagination', require('laravel-vue-pagination'));
1024

1125
// load the front component
1226
new Vue({

0 commit comments

Comments
 (0)