feat(settings): add reset form

zio/stable
三咲智子 2023-01-03 05:17:11 +08:00
parent 5dffd380b0
commit 7bc9f390db
No known key found for this signature in database
GPG Key ID: 69992F2250DFD93E
2 changed files with 17 additions and 8 deletions

View File

@ -59,6 +59,7 @@
"publish": "Publish!", "publish": "Publish!",
"reply": "Reply", "reply": "Reply",
"reply_count": "{0}", "reply_count": "{0}",
"reset": "Reset",
"save": "Save", "save": "Save",
"save_changes": "Save changes", "save_changes": "Save changes",
"sign_in": "Sign in", "sign_in": "Sign in",

View File

@ -129,22 +129,30 @@ const { submit, submitting } = submitter(async ({ dirtyFields }) => {
<SettingsProfileMetadata v-if="isHydrated" v-model:form="form" /> <SettingsProfileMetadata v-if="isHydrated" v-model:form="form" />
</div> </div>
<!-- submit --> <!-- actions -->
<div text-right> <div flex="~ gap2" justify-end>
<button
type="button"
btn-text text-sm
flex gap-x-2 items-center
text-red
@click="reset()"
>
<div aria-hidden="true" i-ri:eraser-line />
{{ $t('action.reset') }}
</button>
<button <button
type="submit" type="submit"
btn-solid rounded-full text-sm btn-solid rounded-full text-sm
flex-inline gap-x-2 items-center flex gap-x-2 items-center
:disabled="submitting || !isCanSubmit" :disabled="submitting || !isCanSubmit"
> >
<span <div
aria-hidden="true" aria-hidden="true"
inline-block
:class="submitting ? 'i-ri:loader-2-fill animate animate-spin' : 'i-ri:save-line'" :class="submitting ? 'i-ri:loader-2-fill animate animate-spin' : 'i-ri:save-line'"
/> />
<span>
{{ $t('action.save') }} {{ $t('action.save') }}
</span>
</button> </button>
</div> </div>
</div> </div>