feat: 添加剪贴板功能,更新用户信息展示,优化用户设置界面
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script lang='ts' setup>
|
||||
import { alertController } from "@ionic/vue";
|
||||
import { alertController, toastController } from "@ionic/vue";
|
||||
import { arrowBackOutline } from "ionicons/icons";
|
||||
import TdesignCopy from "~icons/tdesign/copy";
|
||||
import { authClient } from "@/auth";
|
||||
@@ -31,6 +31,21 @@ async function handleSignOut() {
|
||||
|
||||
await alert.present();
|
||||
}
|
||||
|
||||
const { writeText } = useClipboard();
|
||||
|
||||
function handleCopyUid() {
|
||||
if (userProfile.value?.uid) {
|
||||
writeText(userProfile.value.uid);
|
||||
toastController
|
||||
.create({
|
||||
message: "UID copied to clipboard",
|
||||
duration: 2000,
|
||||
position: "bottom",
|
||||
})
|
||||
.then(toast => toast.present());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -62,8 +77,8 @@ async function handleSignOut() {
|
||||
UID
|
||||
</div>
|
||||
</div>
|
||||
<div class="end">
|
||||
<div>54213213</div>
|
||||
<div class="end" @click="handleCopyUid">
|
||||
<div>{{ userProfile?.uid }}</div>
|
||||
<TdesignCopy />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user