I have problem about fetching data. This is error pops up in the console...
Uncaught Error: Module build failed (from ./node_modules/babel-loader/lib/index.js): SyntaxError: /var/www/html/laravel/resources/js/components/Content.vue: const is a reserved word (8:4)
am I doing something wrong about the usage?
<template>
</template>
<script>
export default {
const axios = require('axios');
axios.get('/ajax')
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
})
.then(function () {
});
}
</script>
also in App.js
require('./bootstrap');
window.Vue = require('vue');
// Vue.component('example-component', require('./components/ExampleComponent.vue').default);
Vue.component('content-wrap', require('./components/Content.vue').default);
const app = new Vue({
el: '#app'
});