@sigelson what do you mean by it is not working?
Feb 24, 2020
6
Level 1
Javascript (Vue.js) not working in mobile and other connected devices but it is working on the desktop where the localhost is running.
Hi! I tried running my laravel project on localhost then I tried connecting it on another mobile devices and desktops/laptops via the localhost address. When I tried to run the function on the desktop that has been hosting the localhost, it is working, but in other devices, it is not working. Here is my code for javascript.
<script>
const app = new Vue({
el:'main',
data:{
dropdown: [],
selected: null,
trans:{}
},
mounted(){
this.getTrans();
},
methods:{
getTrans(){
axios.get('http://localhost/dqrs/api/transactions')
.then((response)=>{
this.trans=response.data
})
.catch(function (error){
console.log(error);
});
},
setDropdown: function (type) {
this.selected = null;
this.dropdown = this.trans[type];
console.log(type)
}
}
})
</script>
Please or to participate in this conversation.