Luego de configurar mi archivo app.js en resources/assets/, cuando corro en la consola npm run dev me lanza este error:
ERROR in ./resources/assets/js/app.js
Module build failed: SyntaxError: C:/xampp/htdocs/logismart/resources
/assets/js/app.js: Unexpected token, expected , (30:15)
28 |
29 | data: {
> 30 | vehiculos []
| ^
31 | },
32 | methods: {
33 | getvehiculos function() {
@ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
npm ERR! code ELIFECYCLE
ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack
/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-
mix/setup/webpack.config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
Mi archivo app.js está como sigue require('./bootstrap');
window.Vue = require('vue');
const app = new Vue({
el: '#crud',
created: function(){
this.getvehiculos();
},
data: {
vehiculos []
},
methods: {
getvehiculos function() {
var urlprueba = 'choferes';
axios.get(urlprueba).then(response =>{
this.vehiculos = response.data
})
}
},
});