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!",
"reply": "Reply",
"reply_count": "{0}",
"reset": "Reset",
"save": "Save",
"save_changes": "Save changes",
"sign_in": "Sign in",

View File

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