This commit is contained in:
kron
2025-06-08 12:52:49 +08:00
parent 5a50632c6c
commit deff79aa7b
15 changed files with 900 additions and 139 deletions

View File

@@ -20,7 +20,16 @@ defineProps({
type: Number,
default: 45,
},
borderColor: {
type: Number,
default: 0,
},
});
const borderColors = {
0: "#fff",
1: "#64BAFF",
2: "#FF6767",
};
</script>
<template>
@@ -29,7 +38,10 @@ defineProps({
v-if="frame"
src="../static/avatar-frame.png"
mode="widthFix"
:style="{ width: Number(size) + 10 + 'px', height: Number(size) + 10 + 'px' }"
:style="{
width: Number(size) + 10 + 'px',
height: Number(size) + 10 + 'px',
}"
class="avatar-frame"
/>
<image
@@ -54,7 +66,12 @@ defineProps({
<image
:src="src"
mode="widthFix"
:style="{ width: size + 'px', height: size + 'px' }"
:style="{
width: size + 'px',
height: size + 'px',
borderColor: borderColors[borderColor],
}"
class="avatar-image"
/>
</view>
</template>
@@ -85,7 +102,7 @@ defineProps({
border-top-left-radius: 50%;
border-bottom-right-radius: 50%;
}
.avatar > image:last-child {
.avatar-image {
border-radius: 50%;
border: 1px solid #fff;
}