I need to make my Javascript file see the vue and axios files

1

I recently created a Laravel project that is using VueJs and Axios, and then I sent it to the Heroku server, however something strange happened, the page is with the very strange preview is giving error in the first line of my app file .js is where it finds all the vue and axios methods I'm using

As you can see the error is in the first line of the vue;

Thisismyapp.jsfile

importVuefrom'vue'importaxiosfrom'axios'newVue({el:'#crud',created:function(){this.getRegistros();},data:{registros:[],newDesc:'',newPreco:'',newQtdQuartos:'',newTipo:'',newFinalidade:'',newLogradouroEndereco:'',newBairroEndereco:'',preencherRegistro:{'id':'','descricao':'','preco':'','qtdQuartos':'',tipos:'',//achoquemeuproblemaestáaqui******'finalidade':'',//achoquemeuproblemaestáaqui******'logradouroEndereco':'','bairroEndereco':''},errors:[]},methods:{getRegistros:function(){varurlRegistro='imovels';axios.get(urlRegistro).then(response=>{this.registros=response.data});},editarRegistro:function(registro){/*alert(registro.tipos);*/this.preencherRegistro.id=registro.id;this.preencherRegistro.descricao=registro.descricao;this.preencherRegistro.preco=registro.preco;this.preencherRegistro.qtdQuartos=registro.qtdQuartos;this.preencherRegistro.tipos=registro.tipos;this.preencherRegistro.finalidade=registro.finalidade;this.preencherRegistro.logradouroEndereco=registro.logradouroEndereco;this.preencherRegistro.bairroEndereco=registro.bairroEndereco;console.log(this.preencherRegistro.tipos);$('#edit').modal('show');},updateRegistro:function(id){varurl='imovels/'+id;axios.put(url,this.preencherRegistro).then(response=>{this.getRegistros();this.preencherRegistro={'id':'','descricao':'','preco':'','qtdQuartos':'',tipos:'','finalidade':'','logradouroEndereco':'','bairroEndereco':''};this.errors=[];$('#edit').modal('hide');toastr.success('Tareaactualizadaconéxito');}).catch(error=>{this.errors='Corrijaparapodereditarconéxito'});},createRegistro:function(){varurl='imovels';axios.post(url,{descricao:this.newDesc,preco:this.newPreco,qtdQuartos:this.newQtdQuartos,tipos:this.newTipo,finalidade:this.newFinalidade,logradouroEndereco:this.newLogradouroEndereco,bairroEndereco:this.newBairroEndereco}).then(response=>{this.getRegistros();this.newDesc='';this.newPreco='';this.newQtdQuartos='';this.newTipo='';this.newFinalidade='';this.newLogradouroEndereco='';this.newBairroEndereco='';this.errors=[];$('#create').modal('hide');//efetuaraexecuçãotoastr.success('Novoimóvelcriadocomsucesso!');}).catch(error=>{this.errors=error.response.data});},deletarRegistro:function(registro){varurl='imovels/'+registro.id;axios.delete(url).then(response=>{this.getRegistros();toastr.success('Registroexcluídocomsucesso');});}}});

Ithinkit'swrongarethisimport's

importVuefrom'vue'importaxiosfrom'axios'

Ihavetoputintherightpaths,seewheremyvueandaxios

I think it's not that difficult to help me, I just do not because I have very little programming experience.

The public folder is in the project root, inside the public folder it has the lib folder and inside the lib folder it has the vue and axes .

    
asked by anonymous 30.10.2017 / 20:26

1 answer

1

import axios from 'axios' is correct, you did the npm install axios, are you using it via npm? I believe this may be the error.

    
01.11.2017 / 10:31