版本发布

This commit is contained in:
icssoa
2025-07-21 16:47:04 +08:00
parent 1abed7a2e1
commit 6d8193880a
307 changed files with 41718 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
<template>
<cl-image
:src="src"
:height="size"
:width="size"
:pt="{
className: parseClass([
'cl-avatar',
{
'!rounded-full': rounded
},
pt.className
])
}"
>
<template #loading>
<cl-icon
:name="pt.icon?.name ?? 'user-smile-fill'"
:size="pt.icon?.size ?? 40"
:pt="{
className: parseClass([
[isDark, '!text-surface-50', '!text-surface-400'],
pt.icon?.className
])
}"
></cl-icon>
</template>
<slot></slot>
</cl-image>
</template>
<script setup lang="ts">
import { isDark, parseClass, parsePt } from "@/cool";
import { computed } from "vue";
import type { ClIconProps } from "../cl-icon/props";
defineOptions({
name: "cl-avatar"
});
const props = defineProps({
pt: {
type: Object,
default: () => ({})
},
src: {
type: String,
default: ""
},
size: {
type: [String, Number],
default: 80
},
rounded: {
type: Boolean,
default: false
}
});
type PassThrough = {
className?: string;
icon?: ClIconProps;
};
const pt = computed(() => parsePt<PassThrough>(props.pt));
</script>

View File

@@ -0,0 +1,14 @@
import type { ClIconProps } from "../cl-icon/props";
export type ClAvatarPassThrough = {
className?: string;
icon?: ClIconProps;
};
export type ClAvatarProps = {
className?: string;
pt?: ClAvatarPassThrough;
src?: string;
size?: any;
rounded?: boolean;
};