fix: 文字过长时头像被挤压

main
ChenZhaoYu 2 years ago
parent ed4ff67760
commit 07b92d4ede

@ -11,8 +11,8 @@ const userInfo = computed(() => userStore.userInfo)
</script> </script>
<template> <template>
<div class="flex items-center"> <div class="flex items-center overflow-hidden">
<div class="w-10 h-10 overflow-hidden rounded-full"> <div class="w-10 h-10 overflow-hidden rounded-full shrink-0">
<template v-if="isString(userInfo.avatar) && userInfo.avatar.length > 0"> <template v-if="isString(userInfo.avatar) && userInfo.avatar.length > 0">
<NAvatar <NAvatar
size="large" size="large"
@ -25,11 +25,11 @@ const userInfo = computed(() => userStore.userInfo)
<NAvatar size="large" round :src="defaultAvatar" /> <NAvatar size="large" round :src="defaultAvatar" />
</template> </template>
</div> </div>
<div class="ml-2"> <div class="flex-1 min-w-0 ml-2">
<h2 class="font-bold text-md"> <h2 class="overflow-hidden font-bold text-md text-ellipsis whitespace-nowrap">
{{ userInfo.name ?? 'ChenZhaoYu' }} {{ userInfo.name ?? 'ChenZhaoYu' }}
</h2> </h2>
<p class="text-xs text-gray-500"> <p class="overflow-hidden text-xs text-gray-500 text-ellipsis whitespace-nowrap">
<span <span
v-if="isString(userInfo.description) && userInfo.description !== ''" v-if="isString(userInfo.description) && userInfo.description !== ''"
v-html="userInfo.description" v-html="userInfo.description"

@ -9,8 +9,9 @@ const show = ref(false)
<template> <template>
<footer class="flex items-center justify-between min-w-0 p-4 overflow-hidden border-t dark:border-neutral-800"> <footer class="flex items-center justify-between min-w-0 p-4 overflow-hidden border-t dark:border-neutral-800">
<UserAvatar /> <div class="flex-1 flex-shrink-0 overflow-hidden">
<UserAvatar />
</div>
<HoverButton :tooltip="$t('setting.setting')" @click="show = true"> <HoverButton :tooltip="$t('setting.setting')" @click="show = true">
<span class="text-xl text-[#4f555e] dark:text-white"> <span class="text-xl text-[#4f555e] dark:text-white">
<SvgIcon icon="ri:settings-4-line" /> <SvgIcon icon="ri:settings-4-line" />

Loading…
Cancel
Save