diff --git a/pages.json b/pages.json index 171856c..2a22c53 100644 --- a/pages.json +++ b/pages.json @@ -316,6 +316,12 @@ "navigationBarTitleText": "Avatar 头像" } }, + { + "path": "data/read-more", + "style": { + "navigationBarTitleText": "ReadMore 查看更多" + } + }, { "path": "data/draggable", "style": { diff --git a/pages/demo/data/read-more.uvue b/pages/demo/data/read-more.uvue new file mode 100644 index 0000000..7f8f6bb --- /dev/null +++ b/pages/demo/data/read-more.uvue @@ -0,0 +1,85 @@ + + + + + diff --git a/pages/index/home.uvue b/pages/index/home.uvue index 3d923f7..b55c4b0 100644 --- a/pages/index/home.uvue +++ b/pages/index/home.uvue @@ -48,7 +48,7 @@ {{ item.label - }} + }}({{ item.children?.length ?? 0 }}) @@ -275,6 +275,11 @@ const data = computed(() => { icon: "account-circle-line", path: "/pages/demo/data/avatar" }, + { + label: t("查看更多"), + icon: "menu-add-line", + path: "/pages/demo/data/read-more" + }, { label: t("列表"), icon: "list-check", diff --git a/uni_modules/cool-ui/components/cl-read-more/cl-read-more.uvue b/uni_modules/cool-ui/components/cl-read-more/cl-read-more.uvue new file mode 100644 index 0000000..d70e905 --- /dev/null +++ b/uni_modules/cool-ui/components/cl-read-more/cl-read-more.uvue @@ -0,0 +1,230 @@ + + + + + diff --git a/uni_modules/cool-ui/components/cl-read-more/props.ts b/uni_modules/cool-ui/components/cl-read-more/props.ts new file mode 100644 index 0000000..55f7cec --- /dev/null +++ b/uni_modules/cool-ui/components/cl-read-more/props.ts @@ -0,0 +1,20 @@ +import type { PassThroughProps } from "../../types"; + +export type ClReadMorePassThrough = { + className?: string; + content?: PassThroughProps; + mask?: PassThroughProps; + toggle?: PassThroughProps; +}; + +export type ClReadMoreProps = { + className?: string; + pt?: ClReadMorePassThrough; + modelValue?: boolean; + height?: any; + expandText?: string; + collapseText?: string; + expandIcon?: string; + collapseIcon?: string; + disabled?: boolean; +}; diff --git a/uni_modules/cool-ui/index.d.ts b/uni_modules/cool-ui/index.d.ts index 9024049..9b2109d 100644 --- a/uni_modules/cool-ui/index.d.ts +++ b/uni_modules/cool-ui/index.d.ts @@ -51,6 +51,7 @@ import type { ClProgressCircleProps, ClProgressCirclePassThrough } from "./compo import type { ClQrcodeProps } from "./components/cl-qrcode/props"; import type { ClRadioProps, ClRadioPassThrough } from "./components/cl-radio/props"; import type { ClRateProps, ClRatePassThrough } from "./components/cl-rate/props"; +import type { ClReadMoreProps, ClReadMorePassThrough } from "./components/cl-read-more/props"; import type { ClRowProps, ClRowPassThrough } from "./components/cl-row/props"; import type { ClSafeAreaProps, ClSafeAreaPassThrough } from "./components/cl-safe-area/props"; import type { ClSelectProps, ClSelectPassThrough } from "./components/cl-select/props"; @@ -130,6 +131,7 @@ declare module "vue" { "cl-qrcode": (typeof import('./components/cl-qrcode/cl-qrcode.uvue')['default']) & import('vue').DefineComponent; "cl-radio": (typeof import('./components/cl-radio/cl-radio.uvue')['default']) & import('vue').DefineComponent; "cl-rate": (typeof import('./components/cl-rate/cl-rate.uvue')['default']) & import('vue').DefineComponent; + "cl-read-more": (typeof import('./components/cl-read-more/cl-read-more.uvue')['default']) & import('vue').DefineComponent; "cl-row": (typeof import('./components/cl-row/cl-row.uvue')['default']) & import('vue').DefineComponent; "cl-safe-area": (typeof import('./components/cl-safe-area/cl-safe-area.uvue')['default']) & import('vue').DefineComponent; "cl-select": (typeof import('./components/cl-select/cl-select.uvue')['default']) & import('vue').DefineComponent; diff --git a/uni_modules/cool-ui/types/component.d.ts b/uni_modules/cool-ui/types/component.d.ts index 9275259..b769938 100644 --- a/uni_modules/cool-ui/types/component.d.ts +++ b/uni_modules/cool-ui/types/component.d.ts @@ -238,3 +238,7 @@ declare type ClMarqueeComponentPublicInstance = { stop(): void; reset(): void; }; + +declare type ClReadMoreComponentPublicInstance = { + toggle(): void; +};