Skip to content

Instantly share code, notes, and snippets.

@vikramIde
Last active June 15, 2017 07:11
Show Gist options
  • Save vikramIde/170b71acbfc14c99d9e5872a8cb562f0 to your computer and use it in GitHub Desktop.
Save vikramIde/170b71acbfc14c99d9e5872a8cb562f0 to your computer and use it in GitHub Desktop.
<script>
export default {
mounted() {
console.log('Component mounted :: SearchGas')
},
data(){
return {
form: new Form({ distributor:'',supplier:'' })
};
},
methods : {
onSubmit(){
let str = "distributor="+this.form.distributor+"&supplierId="+this.form.supplier;
let baseUrl = '/wfengine/price_filter_gas_1/';
//Here I am updating Vikram
this.$router.push('/results/'+baseUrl+'?'+str);
/** this.form.submit('get','/wfengine/price_filter_gas_1/?'+str)
.then(data => console.log(data))
.catch(errors => console.log(errors));**/
}
}
}
</script>
@kevintamez
Copy link

in your routes
////
{
path: "/searchingFor/:item",
component: Busqueda,
}
/////

in your methds

////
search(){
this.searching=false;
this.$router.push('/searchingFor/'+this.searchItem);
}
///

when you go to your results page
////
created(){

  var data={
      item:this.$route.params.item
  }

make your ajax looking for your items
},

///

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment