Skip to content

Commit b89b780

Browse files
committed
feat(/account/bind): show skeleton while loading verification code img
1 parent d7a55f6 commit b89b780

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

pages/account/bind.vue

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
<script setup lang="ts">
2-
import { useForm } from 'vee-validate'
3-
import { toTypedSchema } from '@vee-validate/zod'
4-
import * as z from 'zod'
5-
import { useClerk } from 'vue-clerk'
6-
import { useToast } from '@/components/ui/toast/use-toast'
7-
import Toaster from '@/components/ui/toast/Toaster.vue'
8-
import { FormControl, FormField, FormItem, FormLabel, FormMessage } from '@/components/ui/form'
92
import {
103
AlertDialog,
114
AlertDialogAction,
@@ -17,6 +10,14 @@ import {
1710
AlertDialogTitle,
1811
AlertDialogTrigger,
1912
} from '@/components/ui/alert-dialog'
13+
import { FormControl, FormField, FormItem, FormLabel, FormMessage } from '@/components/ui/form'
14+
import { Skeleton } from '@/components/ui/skeleton'
15+
import Toaster from '@/components/ui/toast/Toaster.vue'
16+
import { useToast } from '@/components/ui/toast/use-toast'
17+
import { toTypedSchema } from '@vee-validate/zod'
18+
import { useForm } from 'vee-validate'
19+
import { useClerk } from 'vue-clerk'
20+
import * as z from 'zod'
2021
2122
const clerk = useClerk()
2223
@@ -181,7 +182,8 @@ const submitConfirm = async function () {
181182
:disabled="isLoading" auto-correct="off" class="mt-1" placeholder="四位验证码" type="text"
182183
v-bind="componentField"
183184
/>
184-
<img :src="`data:image/jpeg;base64, ${initData?.img}`" alt="captcha" class="rounded my-1">
185+
<img v-if="initData?.img" :src="`data:image/jpeg;base64, ${initData?.img}`" alt="captcha" class="rounded my-1">
186+
<Skeleton v-else class="rounded my-1 w-[80px]" />
185187
</div>
186188
</FormControl>
187189
<FormMessage />

0 commit comments

Comments
 (0)