This commit is contained in:
2022-06-27 10:21:54 +08:00
commit 571e582eca
257 changed files with 41968 additions and 0 deletions

27
src/mixins/InitHandler.js Normal file
View File

@@ -0,0 +1,27 @@
import LoadingIndicator from 'common/comps/LoadingIndicator'
export default {
components: { LoadingIndicator },
data () {
return {
loading: true
}
},
methods: {
async onInit (promise) {
this.loading = true
try {
await promise
this.$emit('success')
} catch (error) {
this.$emit('error', error)
} finally {
this.loading = false
}
}
}
}