Created
September 30, 2021 23:40
-
-
Save tuanna-hsp/4056bbcf18f8ac9e1d0409557e034d6b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts"> | |
export default Vue.extend({ | |
watch: { | |
saas: { | |
immediate: true, | |
handler(value): void { | |
if (value) { | |
// Clear current attr values | |
this.clearFormAttributes(); | |
// Initialize form attributes for new service, note that we must use $set to preserve Vue reactiviy on `form` object | |
// (which is required for Vuelidate to work correctly) | |
this.allAttributes.forEach(attr => this.$set(this.form, attr, "")); | |
} | |
}, | |
}, | |
}, | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment