watch: {
rightDrawer: function (val) {
console.log(this.rightDrawer, val)
eventBus.$emit('SearchSwitch', val)
}
},
created () {
eventBus.$on('SearchSwitch', (drawer) => {
this.rightDrawer = drawer
})
}
div(v-for="result in results")
div(@click="handler(result.id)")
div {{result.id}}
div {{result.number}}
methods: {
handler(uid) {
axios.get("http://127.0.0.1:3000/blabla/"+uid).then((response) => {
this.$router.push('/user/'+ response.data[0].id)
}).catch(error => {
console.log(error);
});
}