feat: loading states for modal buttons (#2268)

This commit is contained in:
kyteinsky
2022-04-20 23:48:25 +05:30
committed by GitHub
parent 7bf76a5812
commit 2452b1be4b
13 changed files with 242 additions and 177 deletions

View File

@@ -24,7 +24,11 @@
</template>
<template #footer>
<span>
<ButtonPrimary :label="$t('action.save')" @click.native="addFolder" />
<ButtonPrimary
:label="$t('action.save')"
:loading="loadingState"
@click.native="addFolder"
/>
<ButtonSecondary
:label="$t('action.cancel')"
@click.native="hideModal"
@@ -43,6 +47,7 @@ export default defineComponent({
folder: { type: Object, default: () => {} },
folderPath: { type: String, default: null },
collectionIndex: { type: Number, default: null },
loadingState: Boolean,
},
data() {
return {
@@ -60,7 +65,6 @@ export default defineComponent({
folder: this.folder,
path: this.folderPath || `${this.collectionIndex}`,
})
this.hideModal()
},
hideModal() {
this.name = null