This commit is contained in:
icssoa
2025-07-29 16:16:06 +08:00
parent 752beb9437
commit db2cfc8e59
10 changed files with 43 additions and 26 deletions

View File

@@ -18,7 +18,7 @@
<text class="text-surface-400 text-md">{{ config.description }}</text>
</view>
<view class="cl-action-sheet__list">
<view class="cl-action-sheet__list" :class="[pt.list?.className]">
<view
class="cl-action-sheet__item"
:class="[`${isDark ? '!bg-surface-800' : 'bg-white'}`, pt.item?.className]"
@@ -76,6 +76,7 @@ const props = defineProps({
type PassThrough = {
className?: string; // 根元素类名
item?: PassThroughProps; // 列表项样式
list?: PassThroughProps; // 列表样式
};
// 解析透传样式配置

View File

@@ -3,6 +3,7 @@ import type { ClActionSheetItem, ClActionSheetOptions, PassThroughProps } from "
export type ClActionSheetPassThrough = {
className?: string;
item?: PassThroughProps;
list?: PassThroughProps;
};
export type ClActionSheetProps = {

View File

@@ -15,7 +15,4 @@ export type ClSignProps = {
maxStrokeWidth?: number;
velocitySensitivity?: number;
autoRotate?: boolean;
landscapeWidthRatio?: number;
landscapeHeightRatio?: number;
fullscreen?: boolean;
};

View File

@@ -17,5 +17,6 @@ export type ClSliderProps = {
step?: number;
disabled?: boolean;
blockSize?: number;
trackHeight?: number;
showValue?: boolean;
};

View File

@@ -37,7 +37,7 @@
>
<cl-loading
v-if="loading"
size="12px"
:size="24"
color="primary"
:pt="{
className: parseClass([pt.loading?.className])
@@ -83,12 +83,12 @@ const props = defineProps({
// 高度
height: {
type: Number,
default: 24
default: 48
},
// 宽度
width: {
type: Number,
default: 40
default: 80
}
});
@@ -126,19 +126,19 @@ const rect = computed<Rect>(() => {
const height = props.height;
// 获取开关轨道宽度
const width = props.width;
// 计算圆形按钮尺寸,比轨道高度小4px
const size = height - 4;
// 设置圆形按钮初始位置,距离左侧2px
const left = 2;
// 计算圆形按钮尺寸,比轨道高度小8rpx
const size = height - 8;
// 设置圆形按钮初始位置,距离左侧px
const left = 4;
// 计算圆形按钮移动距离,为轨道宽度减去轨道高度
const translateX = width - height;
return {
height: height + "px",
width: width + "px",
size: size + "px",
left: left + "px",
translateX: translateX + "px"
height: height + "rpx",
width: width + "rpx",
size: size + "rpx",
left: left + "rpx",
translateX: translateX + "rpx"
};
});