responsive name

This commit is contained in:
Cindy Chang
2024-08-29 14:41:41 +08:00
parent 1883818b8b
commit 3a44b74bbc
3 changed files with 8 additions and 20 deletions

View File

@@ -128,7 +128,7 @@ export default {
const visitTime = ref(0);
const currentViewingUser = computed(() => acctMgmtStore.currentViewingUser);
const name = computed(() => acctMgmtStore.currentViewingUser.name);
const name = computed(() => currentViewingUser.value.name);
const {
username,
is_admin,
@@ -180,18 +180,9 @@ export default {
isPwdLengthValid.value = inputPwd.value.length >= PWD_VALID_LENGTH;
}
watch(() => acctMgmtStore.currentViewingUser, (newVal, oldVal) => {
console.log('currentViewingUser updated:', newVal);
console.log('newVal.name', newVal.name);
});
onBeforeMount(async() => {
// 在此設定 current viewing user 的來源是登入者的身分
await acctMgmtStore.getUserDetail(loginStore.userData.username);
});
onMounted(() => {
onMounted(async() => {
loadingStore.setIsLoading(false);
await acctMgmtStore.getUserDetail(loginStore.userData.username);
});
return {