0👍
It’s just like updating any other reactive property. The example below shows three states… default, loading and updated.
<template>
<div id="app">
<b-alert show>{{ alertText }}</b-alert>
<b-btn @click="updateText">Update Text</b-btn>
</div>
</template>
<script>
export default {
name: "App",
data() {
return {
alertText: 'Default text',
}
},
methods: {
updateText() {
this.alertText = 'loading'
setTimeout(() => {
this.alertText = Math.random()
}, 2000)
},
}
}
</script>
- [Vuejs]-Vuejs loop over in data results not on how many fields i have
- [Vuejs]-Get DRF paginated endpoint from axios
Source:stackexchange.com