hello guys are this possible to assign a value to axios success so I can use that variable into other function for eg :-
<script>
var x ="";
export default {
methods:{
getshop(){
this.$http.get('http://localhost:3000/api/shopestablishments') .then(function (response) {
return x= response.data;//how i can assign value of x from here
})
},
onClick(){
// how I can use assign variables of x over here
},
},
}
</script>
i search a lot and got confused how i can do this thing