0👍
You can use the mounted
event for the initialization. And you can use the watch
for the updates:
The code would be that way:
export default {
name: 'app',
data: () => ({
orderDetailsDialogVisible: false,
}),
watch: {
orderDetailsDialogVisible(newValue, oldValue) {
if (newValue) {
this.requestApi();
}
},
},
methods: {
requestApi() {
console.log('requestApi');
// axios.get...
},
},
mounted() {
this.requestApi();
},
};
- [Vuejs]-Vue filepond component multiple instance on the same page causing input event emitter is saving in last component's v-model
- [Vuejs]-Vue html/text editor v-html not working when posted/put (added/edited)
Source:stackexchange.com