This commit is contained in:
icssoa
2025-10-20 10:40:54 +08:00
parent c173f231fe
commit a6e469b799
8 changed files with 23 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "cool-unix",
"version": "8.0.26",
"version": "8.0.27",
"license": "MIT",
"scripts": {
"build-ui": "node ./uni_modules/cool-ui/scripts/generate-types.js",

View File

@@ -119,7 +119,7 @@ function open(options: ClActionSheetOptions) {
config.description = options.description ?? "";
// 更新操作列表
config.list = options.list;
config.list = [...options.list] as ClActionSheetItem[];
// 取消按钮文本
config.cancelText = options.cancelText ?? t("取消");

View File

@@ -14,6 +14,8 @@ export type ClCalendarSelectProps = {
date?: string[];
mode?: ClCalendarMode;
dateConfig?: ClCalendarDateConfig[];
start: string;
end: string;
title?: string;
placeholder?: string;
showTrigger?: boolean;

View File

@@ -3,6 +3,7 @@ import type { PassThroughProps } from "../../types";
export type ClFooterPassThrough = {
className?: string;
content?: PassThroughProps;
wrapper?: PassThroughProps;
};
export type ClFooterProps = {

View File

@@ -4,6 +4,7 @@ import type { ClImageProps } from "../cl-image/props";
export type ClListItemPassThrough = {
className?: string;
wrapper?: PassThroughProps;
inner?: PassThroughProps;
label?: PassThroughProps;
content?: PassThroughProps;

View File

@@ -2,7 +2,9 @@ import type { PassThroughProps } from "../../types";
export type ClReadMorePassThrough = {
className?: string;
wrapper?: PassThroughProps;
content?: PassThroughProps;
contentText?: PassThroughProps;
mask?: PassThroughProps;
toggle?: PassThroughProps;
};
@@ -11,10 +13,13 @@ export type ClReadMoreProps = {
className?: string;
pt?: ClReadMorePassThrough;
modelValue?: boolean;
content?: string;
height?: any;
expandText?: string;
collapseText?: string;
expandIcon?: string;
collapseIcon?: string;
disabled?: boolean;
showToggle?: boolean;
showMask?: boolean;
};

View File

@@ -14,6 +14,7 @@ export type ClTopbarProps = {
color?: string;
backgroundColor?: string;
showBack?: boolean;
backable?: boolean;
backPath?: string;
backIcon?: string;
safeAreaTop?: boolean;

View File

@@ -31,7 +31,7 @@
</template>
<script setup lang="ts">
import { assign } from "@/cool";
import { assign, isNull } from "@/cool";
import { computed, getCurrentInstance, nextTick, onMounted, ref, watch } from "vue";
import { parsePt } from "@/cool";
@@ -86,9 +86,9 @@ const columns = ref<UTSJSONObject[][]>([]);
/**
* 获取各列的当前高度
* 通过uni.createSelectorQuery查询DOM元素的实际高度
* @returns Promise<number> 返回Promise对象
* @returns Promise<> 返回Promise对象
*/
async function getHeight(): Promise<number> {
async function getHeight(): Promise<void> {
// 等待DOM更新完成
await nextTick();
@@ -99,9 +99,14 @@ async function getHeight(): Promise<number> {
.selectAll(".cl-waterfall__column-inner")
.boundingClientRect()
.exec((rect) => {
// 提取每列的高度信息如果获取失败则默认为0
heights.value = (rect[0] as NodeInfo[]).map((e) => e.height ?? 0);
resolve(1);
const nodes = rect[0] as NodeInfo[];
if (!isNull(nodes)) {
// 提取每列的高度信息如果获取失败则默认为0
heights.value = nodes.map((e) => e.height ?? 0);
}
resolve();
});
});
}