From 2148d333cda327c77e6b55e3835904d22a8aec32 Mon Sep 17 00:00:00 2001
From: novlan1 <1576271227@qq.com>
Date: Fri, 12 Jun 2026 19:30:45 +0800
Subject: [PATCH 01/11] =?UTF-8?q?fix(message):=20=E4=BF=AE=E5=A4=8D?=
=?UTF-8?q?=E8=BF=9E=E7=BB=AD=E7=82=B9=E5=87=BB=E6=97=B6=E7=9A=84=E6=8A=A5?=
=?UTF-8?q?=E9=94=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../message-item/message-item.vue | 10 ++-
.../uniapp-components/message/message.vue | 84 +++++++++++++++----
2 files changed, 75 insertions(+), 19 deletions(-)
diff --git a/packages/uniapp-components/message-item/message-item.vue b/packages/uniapp-components/message-item/message-item.vue
index fbac4de06..de838a648 100644
--- a/packages/uniapp-components/message-item/message-item.vue
+++ b/packages/uniapp-components/message-item/message-item.vue
@@ -120,6 +120,7 @@ const rawData = {
fadeClass: '',
closeTimeoutContext: 0,
+ hideTimeoutContext: 0,
nextAnimationContext: 0,
resetAnimation: uni.createAnimation({
duration: 0,
@@ -328,9 +329,10 @@ export default {
this.reset();
this.fadeClass = `${name}__fade`;
- setTimeout(() => {
+ this.hideTimeoutContext = setTimeout(() => {
this.visible = false;
this.animation = [];
+ this.hideTimeoutContext = 0;
}, SHOW_DURATION);
if (typeof this.onHide === 'function') {
this.onHide();
@@ -344,6 +346,12 @@ export default {
}
clearTimeout(this.closeTimeoutContext);
this.closeTimeoutContext = 0;
+ // 同时清掉上一次 hide 中用于延迟将 visible 置 false 的定时器,
+ // 避免连续快速调用 hide 后又调 show 时,旧的 timeout 把新消息 hide 掉。
+ if (this.hideTimeoutContext) {
+ clearTimeout(this.hideTimeoutContext);
+ this.hideTimeoutContext = 0;
+ }
},
handleClose() {
diff --git a/packages/uniapp-components/message/message.vue b/packages/uniapp-components/message/message.vue
index 348300ebc..3cc2ee6f1 100644
--- a/packages/uniapp-components/message/message.vue
+++ b/packages/uniapp-components/message/message.vue
@@ -1,30 +1,43 @@
handleClose(e, { tagId: item.id })"
@link-click="(e) => handleLinkClick(e, { tagId: item.id })"
@duration-end="(e) => handleDurationEnd(e, { tagId: item.id })"
>
-
+
+
-
+
-
-
+
+
-
+
@@ -92,26 +105,36 @@ export default {
created() {
this.instances = [];
+ // 记录各 id 对应的延迟移除 messageList 占位的定时器,避免连续点击时上一次 close 的
+ // 延迟移除在复用过程中把新占位也干掉导致 ref 实例释放、新消息闪退。
+ this.removeMsgTimers = {};
},
mounted() {
},
methods: {
- /**
- * 设置消息信息
- * @param msg
- * @param theme
- */
+ /**
+ * 设置消息信息
+ * @param msg
+ * @param theme
+ */
setMessage(msg, theme = MessageType.info) {
if (!this.instances) {
this.instances = [];
}
+ // 过滤掉之前可能 push 进来的 undefined,避免 findIndex 报错
+ this.instances = this.instances.filter(Boolean);
let id = `${name}_${this.index}`;
if (msg.single) {
// 不能与外层的 ref 相同,否则抖音小程序报错
id = `${name}_inner`;
}
+ // 若存在同 id 的 pending removeMsg 定时器,先取消掉,避免复用后被延迟销毁。
+ if (this.removeMsgTimers && this.removeMsgTimers[id]) {
+ clearTimeout(this.removeMsgTimers[id]);
+ delete this.removeMsgTimers[id];
+ }
const gap = unitConvert(msg.gap || this.gap);
const msgObj = {
...msg,
@@ -119,13 +142,21 @@ export default {
id,
gap,
};
- const instanceIndex = this.instances.findIndex(x => x.id === id);
+ const instanceIndex = this.instances.findIndex(x => x && x.id === id);
if (instanceIndex < 0) {
this.addMessage(msgObj);
} else {
// 更新消息
const instance = this.instances[instanceIndex];
const offsetHeight = this.getOffsetHeight(instanceIndex);
+ // 复用实例前先清掉上一次 show 启动的 duration/animation 定时器,
+ // 否则 resetData 只是把 closeTimeoutContext 字段重置为 0,原 timeout 仍会触发 hide,
+ // 导致新展示的消息不到 duration 就消失。
+ if (typeof instance.reset === 'function') {
+ instance.reset();
+ }
+ // 旧的 onHide 也要清掉,避免旧回调把新消息从 instances 中移除
+ instance.onHide = null;
instance.resetData(() => {
Object.keys(msgObj).forEach((key) => {
instance[key] = msgObj[key];
@@ -145,13 +176,17 @@ export default {
* @param msgObj
*/
addMessage(msgObj) {
- const list = [...this.messageList, { id: msgObj.id }];
- this.messageList = list;
+ // single 模式下若已经有同 id 的占位,直接复用并跳过 add,避免列表中出现重复 id
+ const existIndex = this.messageList.findIndex(x => x.id === msgObj.id);
+ if (existIndex < 0) {
+ this.messageList = [...this.messageList, { id: msgObj.id }];
+ }
setTimeout(() => {
const offsetHeight = this.getOffsetHeight();
const instance = this.showMessageItem(msgObj, msgObj.id, offsetHeight);
- if (this.instances) {
+ // instance 可能为 undefined,避免污染 instances 导致后续 findIndex 异常
+ if (this.instances && instance) {
this.instances.push(instance);
this.index += 1;
}
@@ -190,6 +225,11 @@ export default {
}
if (instance) {
+ // 复用同一 ref 时同样要先清掉旧定时器与旧 onHide,避免互相干扰
+ if (typeof instance.reset === 'function') {
+ instance.reset();
+ }
+ instance.onHide = null;
instance.resetData(() => {
Object.keys(options).forEach((key) => {
instance[key] = options[key];
@@ -208,8 +248,16 @@ export default {
},
close(id) {
- setTimeout(() => {
+ if (!this.removeMsgTimers) {
+ this.removeMsgTimers = {};
+ }
+ // 多次 close 同一 id 时,先清掉旧的 pending removeMsg 定时器
+ if (this.removeMsgTimers[id]) {
+ clearTimeout(this.removeMsgTimers[id]);
+ }
+ this.removeMsgTimers[id] = setTimeout(() => {
this.removeMsg(id);
+ delete this.removeMsgTimers[id];
}, SHOW_DURATION);
this.removeInstance(id);
},
@@ -222,7 +270,7 @@ export default {
if (!id) {
this.hideAll();
}
- const instance = this.instances.find(x => x.id === id);
+ const instance = this.instances.find(x => x && x.id === id);
if (instance) {
instance.hide();
}
@@ -243,7 +291,7 @@ export default {
* 移除message实例
*/
removeInstance(id) {
- const index = this.instances.findIndex(x => x.id === id);
+ const index = this.instances.findIndex(x => x && x.id === id);
if (index < 0) return;
const instance = this.instances[index];
const removedHeight = instance.height;
From 7163c2dfc9198d8ecb977c1a1fac19a1041d382f Mon Sep 17 00:00:00 2001
From: novlan1 <1576271227@qq.com>
Date: Fri, 12 Jun 2026 19:44:45 +0800
Subject: [PATCH 02/11] chore: update UniApp to Uniapp
---
packages/tdesign-uniapp-chat/package.json | 2 +-
packages/tdesign-uniapp-chat/script/postinstall.js | 6 +++---
.../tdesign-uniapp-chat/site/docs/custom-style.md | 4 ++--
.../tdesign-uniapp-chat/site/docs/custom-theme.md | 4 ++--
.../tdesign-uniapp-chat/site/docs/dark-mode.md | 2 +-
packages/tdesign-uniapp-chat/site/docs/faq.md | 6 +++---
.../site/docs/getting-started.en-US.md | 4 ++--
.../site/docs/getting-started.md | 4 ++--
.../site/web/stackblitz/content.ts | 4 ++--
packages/tdesign-uniapp/README.md | 10 +++++-----
packages/tdesign-uniapp/example/index.html | 2 +-
packages/tdesign-uniapp/example/src/manifest.json | 4 ++--
packages/tdesign-uniapp/example/src/pages.json | 4 ++--
packages/tdesign-uniapp/package.json | 2 +-
packages/tdesign-uniapp/script/postinstall.js | 6 +++---
packages/tdesign-uniapp/site/docs/custom-style.md | 4 ++--
packages/tdesign-uniapp/site/docs/custom-theme.md | 4 ++--
packages/tdesign-uniapp/site/docs/dark-mode.md | 2 +-
packages/tdesign-uniapp/site/docs/faq.md | 2 +-
.../site/docs/getting-started.en-US.md | 14 +++++++-------
.../tdesign-uniapp/site/docs/getting-started.md | 14 +++++++-------
.../tdesign-uniapp/site/web/stackblitz/content.ts | 4 ++--
22 files changed, 54 insertions(+), 54 deletions(-)
diff --git a/packages/tdesign-uniapp-chat/package.json b/packages/tdesign-uniapp-chat/package.json
index 5f85cfff0..845a3bd4c 100644
--- a/packages/tdesign-uniapp-chat/package.json
+++ b/packages/tdesign-uniapp-chat/package.json
@@ -3,7 +3,7 @@
"version": "0.2.4",
"id": "tdesign-uniapp-chat",
"title": "tdesign-uniapp-chat",
- "description": "TDesign Chat Component for UniApp",
+ "description": "TDesign Chat Component for Uniapp",
"author": "tdesign",
"license": "MIT",
"keywords": [
diff --git a/packages/tdesign-uniapp-chat/script/postinstall.js b/packages/tdesign-uniapp-chat/script/postinstall.js
index 91eed1a8f..4422bddbf 100644
--- a/packages/tdesign-uniapp-chat/script/postinstall.js
+++ b/packages/tdesign-uniapp-chat/script/postinstall.js
@@ -17,7 +17,7 @@ function isUserInstall() {
function printVue2PostCSSWarning() {
console.warn('\n');
- console.warn('⚠️ [TDesign UniApp Chat] 检测到当前使用 Vue2 环境');
+ console.warn('⚠️ [TDesign Uniapp Chat] 检测到当前使用 Vue2 环境');
console.warn(' Vue2 项目需要在 postcss.config.js 中进行适配,否则样式可能无法正常工作。');
console.warn('');
console.warn(' 📖 适配指南: https://juejin.cn/post/7602901195154030644');
@@ -73,14 +73,14 @@ function main() {
const version = detectVueVersion();
if (!version) {
- console.warn('[TDesign UniApp Chat] Vue is not found. Please run "npm install vue" to install.');
+ console.warn('[TDesign Uniapp Chat] Vue is not found. Please run "npm install vue" to install.');
return;
}
if (isVue2(version)) {
printVue2PostCSSWarning();
} else if (!isVue3(version)) {
- console.warn(`[TDesign UniApp Chat] Vue version ${version} is not supported.`);
+ console.warn(`[TDesign Uniapp Chat] Vue version ${version} is not supported.`);
}
}
diff --git a/packages/tdesign-uniapp-chat/site/docs/custom-style.md b/packages/tdesign-uniapp-chat/site/docs/custom-style.md
index 4f3df2fae..e14bbee2f 100644
--- a/packages/tdesign-uniapp-chat/site/docs/custom-style.md
+++ b/packages/tdesign-uniapp-chat/site/docs/custom-style.md
@@ -4,7 +4,7 @@ description: TDesign 提供了多种方式可以实现样式覆盖
spline: explain
---
-TDesign UniApp 提供了 4 种方式用于样式覆盖
+TDesign Uniapp 提供了 4 种方式用于样式覆盖
## 1 使用 Custom Style
@@ -108,7 +108,7 @@ TDesign 在每个组件的内部都预置了许多外部样式类供开发者使
}
```
-**实现上,TDesign UniApp 将外部样式类都转成了 `props`**
+**实现上,TDesign Uniapp 将外部样式类都转成了 `props`**
## 4 使用 CSS 变量
diff --git a/packages/tdesign-uniapp-chat/site/docs/custom-theme.md b/packages/tdesign-uniapp-chat/site/docs/custom-theme.md
index c1c9390c6..abcf0fb74 100644
--- a/packages/tdesign-uniapp-chat/site/docs/custom-theme.md
+++ b/packages/tdesign-uniapp-chat/site/docs/custom-theme.md
@@ -8,7 +8,7 @@ spline: explain
## 全局自定义
-TDesign UniApp 的 CSS Variables 全部定义可以在这里看到: [_variables.less](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/common/style/_variables.less)
+TDesign Uniapp 的 CSS Variables 全部定义可以在这里看到: [_variables.less](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/common/style/_variables.less)
如果你想改变主题色,主要改变这几个变量即可:
@@ -31,7 +31,7 @@ page {
## 局部自定义
-在 TDesign UniApp 里,你也可以只给某个组件修改主题,下面以 `Rate` 举例:
+在 TDesign Uniapp 里,你也可以只给某个组件修改主题,下面以 `Rate` 举例:
```css
page {
diff --git a/packages/tdesign-uniapp-chat/site/docs/dark-mode.md b/packages/tdesign-uniapp-chat/site/docs/dark-mode.md
index b9723f5cd..faddc08db 100644
--- a/packages/tdesign-uniapp-chat/site/docs/dark-mode.md
+++ b/packages/tdesign-uniapp-chat/site/docs/dark-mode.md
@@ -17,7 +17,7 @@ spline: design-mode
## 实现方案
-TDesign UniApp 基于 Design Token 变量和媒体查询 `prefers-color-scheme` 实现了深色模式。默认情况下,每个组件自带了组件级别 light 样式变量,无需手动引入。如需使用深色模式,请按照以下步骤操作。
+TDesign Uniapp 基于 Design Token 变量和媒体查询 `prefers-color-scheme` 实现了深色模式。默认情况下,每个组件自带了组件级别 light 样式变量,无需手动引入。如需使用深色模式,请按照以下步骤操作。
## 使用方式
diff --git a/packages/tdesign-uniapp-chat/site/docs/faq.md b/packages/tdesign-uniapp-chat/site/docs/faq.md
index 911d40bfa..b120cf804 100644
--- a/packages/tdesign-uniapp-chat/site/docs/faq.md
+++ b/packages/tdesign-uniapp-chat/site/docs/faq.md
@@ -4,11 +4,11 @@ description: 看看有没有你想要的。
spline: explain
---
-### 与 TDesign UniApp 库的关系
+### 与 TDesign Uniapp 库的关系
-[TDsign UniApp](https://www.npmjs.com/package/@tdesign/uniapp) 和 [TDesign UniApp Chat](https://www.npmjs.com/package/@tdesign/uniapp-chat) 是两个不同的包,后者依赖前者。
+[TDesign Uniapp](https://www.npmjs.com/package/@tdesign/uniapp) 和 [TDesign Uniapp Chat](https://www.npmjs.com/package/@tdesign/uniapp-chat) 是两个不同的包,后者依赖前者。
-样式文件从 TDesign UniApp 引入一份即可。
+样式文件从 TDesign Uniapp 引入一份即可。
```js
import '@tdesign/uniapp/theme.css';
diff --git a/packages/tdesign-uniapp-chat/site/docs/getting-started.en-US.md b/packages/tdesign-uniapp-chat/site/docs/getting-started.en-US.md
index 7425fff09..3fbc1b098 100644
--- a/packages/tdesign-uniapp-chat/site/docs/getting-started.en-US.md
+++ b/packages/tdesign-uniapp-chat/site/docs/getting-started.en-US.md
@@ -1,6 +1,6 @@
---
title: Uni App Chat
-description: TDesign UniApp Chat is a UI component library for Uni App.
+description: TDesign Uniapp Chat is a UI component library for Uni App.
spline: explain
---
@@ -8,7 +8,7 @@ spline: explain
- Starting from version 0.2.0, the npm package name for the TDesign UniApp Chat component library has changed from tdesign-uniapp-chat to @tdesign/uniapp-chat.
+ Starting from version 0.2.0, the npm package name for the TDesign Uniapp Chat component library has changed from tdesign-uniapp-chat to @tdesign/uniapp-chat.
## Preview
diff --git a/packages/tdesign-uniapp-chat/site/docs/getting-started.md b/packages/tdesign-uniapp-chat/site/docs/getting-started.md
index 9acdfdabb..39c4e9a30 100644
--- a/packages/tdesign-uniapp-chat/site/docs/getting-started.md
+++ b/packages/tdesign-uniapp-chat/site/docs/getting-started.md
@@ -1,6 +1,6 @@
---
title: Uni App Chat
-description: TDesign UniApp Chat 组件库。
+description: TDesign Uniapp Chat 组件库。
spline: explain
---
@@ -8,7 +8,7 @@ spline: explain
- TDesign UniApp Chat 组件库 npm 包名自 0.2.0 版本开始,从 tdesign-uniapp-chat 变更为 @tdesign/uniapp-chat
+ TDesign Uniapp Chat 组件库 npm 包名自 0.2.0 版本开始,从 tdesign-uniapp-chat 变更为 @tdesign/uniapp-chat
## 预览
diff --git a/packages/tdesign-uniapp-chat/site/web/stackblitz/content.ts b/packages/tdesign-uniapp-chat/site/web/stackblitz/content.ts
index 3a862aa0c..db4ea9288 100644
--- a/packages/tdesign-uniapp-chat/site/web/stackblitz/content.ts
+++ b/packages/tdesign-uniapp-chat/site/web/stackblitz/content.ts
@@ -42,7 +42,7 @@ export function createApp() {
`;
export const MANIFEST_JSON_CONTENT = JSON.stringify({
- name: 'TDesign UniApp',
+ name: 'TDesign Uniapp',
appid: '',
description: '',
versionName: '1.0.0',
@@ -111,7 +111,7 @@ export const PAGES_JSON_CONTENT = JSON.stringify({
{
path: 'pages/index/index',
style: {
- navigationBarTitleText: 'TDesign UniApp',
+ navigationBarTitleText: 'TDesign Uniapp',
},
},
],
diff --git a/packages/tdesign-uniapp/README.md b/packages/tdesign-uniapp/README.md
index 8f090c808..e6c344a61 100644
--- a/packages/tdesign-uniapp/README.md
+++ b/packages/tdesign-uniapp/README.md
@@ -167,11 +167,11 @@ import TLoading from '@tdesign/uniapp/loading/loading.vue';
| 模板 | 描述 | 预览 |
| --- | --- | --- |
-| [TDesign UniApp Starter](https://github.com/TDesignOteam/tdesign-uniapp-starter/) | Vue3 + CLI 模式模板 - 通用类 |
|
-| [TDesign UniApp Starter Apply](https://github.com/TDesignOteam/tdesign-uniapp-starter-apply/) | Vue3 + CLI 模式模板 - 活动报名 |
|
-| [TDesign UniApp Starter Vue3 HX](https://github.com/TDesignOteam/tdesign-uniapp-starter-vue3-hx/) | Vue3 + HBuilderX 模式模板 |
|
-| [TDesign UniApp Starter Vue2 CLI](https://github.com/TDesignOteam/tdesign-uniapp-starter-vue2-cli/) | Vue2 + CLI 模式模板 |
|
-| [TDesign UniApp Starter Vue2 HX](https://github.com/TDesignOteam/tdesign-uniapp-starter-vue2-hx/) | Vue2 + HBuilderX 模式模板 |
|
+| [TDesign Uniapp Starter](https://github.com/TDesignOteam/tdesign-uniapp-starter/) | Vue3 + CLI 模式模板 - 通用类 |
|
+| [TDesign Uniapp Starter Apply](https://github.com/TDesignOteam/tdesign-uniapp-starter-apply/) | Vue3 + CLI 模式模板 - 活动报名 |
|
+| [TDesign Uniapp Starter Vue3 HX](https://github.com/TDesignOteam/tdesign-uniapp-starter-vue3-hx/) | Vue3 + HBuilderX 模式模板 |
|
+| [TDesign Uniapp Starter Vue2 CLI](https://github.com/TDesignOteam/tdesign-uniapp-starter-vue2-cli/) | Vue2 + CLI 模式模板 |
|
+| [TDesign Uniapp Starter Vue2 HX](https://github.com/TDesignOteam/tdesign-uniapp-starter-vue2-hx/) | Vue2 + HBuilderX 模式模板 |
|
## 反馈
有任何问题,建议通过 [Github issues](https://github.com/Tencent/tdesign-miniprogram/issues) 反馈或扫码加入用户微信群。
diff --git a/packages/tdesign-uniapp/example/index.html b/packages/tdesign-uniapp/example/index.html
index 0edcb8889..ddf7f982b 100644
--- a/packages/tdesign-uniapp/example/index.html
+++ b/packages/tdesign-uniapp/example/index.html
@@ -13,7 +13,7 @@
'" />',
);
- TDesign UniApp
+ TDesign Uniapp
diff --git a/packages/tdesign-uniapp/example/src/manifest.json b/packages/tdesign-uniapp/example/src/manifest.json
index 89747bb91..c401325f4 100644
--- a/packages/tdesign-uniapp/example/src/manifest.json
+++ b/packages/tdesign-uniapp/example/src/manifest.json
@@ -1,5 +1,5 @@
{
- "name": "TDesign UniApp",
+ "name": "TDesign Uniapp",
"appid": "",
"description": "",
"versionName": "1.0.0",
@@ -123,4 +123,4 @@
"enable": false
},
"vueVersion": "3"
-}
+}
\ No newline at end of file
diff --git a/packages/tdesign-uniapp/example/src/pages.json b/packages/tdesign-uniapp/example/src/pages.json
index 13723f139..52716ea72 100644
--- a/packages/tdesign-uniapp/example/src/pages.json
+++ b/packages/tdesign-uniapp/example/src/pages.json
@@ -450,7 +450,7 @@
"globalStyle": {
"pageOrientation": "portrait",
"navigationBarTextStyle": "black",
- "navigationBarTitleText": "TDesign UniApp",
+ "navigationBarTitleText": "TDesign Uniapp",
"backgroundColor": "#F8F8F8",
"navigationStyle": "custom"
},
@@ -801,4 +801,4 @@
]
}
}
-}
+}
\ No newline at end of file
diff --git a/packages/tdesign-uniapp/package.json b/packages/tdesign-uniapp/package.json
index 01e746e3b..84e04ec57 100644
--- a/packages/tdesign-uniapp/package.json
+++ b/packages/tdesign-uniapp/package.json
@@ -3,7 +3,7 @@
"version": "0.9.1",
"id": "tdesign-uniapp",
"title": "tdesign-uniapp",
- "description": "TDesign Component for UniApp",
+ "description": "TDesign Component for Uniapp",
"author": "tdesign",
"license": "MIT",
"keywords": [
diff --git a/packages/tdesign-uniapp/script/postinstall.js b/packages/tdesign-uniapp/script/postinstall.js
index 15d214b06..b060f637c 100644
--- a/packages/tdesign-uniapp/script/postinstall.js
+++ b/packages/tdesign-uniapp/script/postinstall.js
@@ -17,7 +17,7 @@ function isUserInstall() {
function printVue2PostCSSWarning() {
console.warn('\n');
- console.warn('⚠️ [TDesign UniApp] 检测到当前使用 Vue2 环境');
+ console.warn('⚠️ [TDesign Uniapp] 检测到当前使用 Vue2 环境');
console.warn(' Vue2 项目需要在 postcss.config.js 中进行适配,否则样式可能无法正常工作。');
console.warn('');
console.warn(' 📖 适配指南: https://juejin.cn/post/7602901195154030644');
@@ -73,14 +73,14 @@ function main() {
const version = detectVueVersion();
if (!version) {
- console.warn('[TDesign UniApp] Vue is not found. Please run "npm install vue" to install.');
+ console.warn('[TDesign Uniapp] Vue is not found. Please run "npm install vue" to install.');
return;
}
if (isVue2(version)) {
printVue2PostCSSWarning();
} else if (!isVue3(version)) {
- console.warn(`[TDesign UniApp] Vue version ${version} is not supported.`);
+ console.warn(`[TDesign Uniapp] Vue version ${version} is not supported.`);
}
}
diff --git a/packages/tdesign-uniapp/site/docs/custom-style.md b/packages/tdesign-uniapp/site/docs/custom-style.md
index 4f3df2fae..e14bbee2f 100644
--- a/packages/tdesign-uniapp/site/docs/custom-style.md
+++ b/packages/tdesign-uniapp/site/docs/custom-style.md
@@ -4,7 +4,7 @@ description: TDesign 提供了多种方式可以实现样式覆盖
spline: explain
---
-TDesign UniApp 提供了 4 种方式用于样式覆盖
+TDesign Uniapp 提供了 4 种方式用于样式覆盖
## 1 使用 Custom Style
@@ -108,7 +108,7 @@ TDesign 在每个组件的内部都预置了许多外部样式类供开发者使
}
```
-**实现上,TDesign UniApp 将外部样式类都转成了 `props`**
+**实现上,TDesign Uniapp 将外部样式类都转成了 `props`**
## 4 使用 CSS 变量
diff --git a/packages/tdesign-uniapp/site/docs/custom-theme.md b/packages/tdesign-uniapp/site/docs/custom-theme.md
index c1c9390c6..abcf0fb74 100644
--- a/packages/tdesign-uniapp/site/docs/custom-theme.md
+++ b/packages/tdesign-uniapp/site/docs/custom-theme.md
@@ -8,7 +8,7 @@ spline: explain
## 全局自定义
-TDesign UniApp 的 CSS Variables 全部定义可以在这里看到: [_variables.less](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/common/style/_variables.less)
+TDesign Uniapp 的 CSS Variables 全部定义可以在这里看到: [_variables.less](https://github.com/Tencent/tdesign-miniprogram/tree/develop/packages/uniapp-components/common/style/_variables.less)
如果你想改变主题色,主要改变这几个变量即可:
@@ -31,7 +31,7 @@ page {
## 局部自定义
-在 TDesign UniApp 里,你也可以只给某个组件修改主题,下面以 `Rate` 举例:
+在 TDesign Uniapp 里,你也可以只给某个组件修改主题,下面以 `Rate` 举例:
```css
page {
diff --git a/packages/tdesign-uniapp/site/docs/dark-mode.md b/packages/tdesign-uniapp/site/docs/dark-mode.md
index b9723f5cd..faddc08db 100644
--- a/packages/tdesign-uniapp/site/docs/dark-mode.md
+++ b/packages/tdesign-uniapp/site/docs/dark-mode.md
@@ -17,7 +17,7 @@ spline: design-mode
## 实现方案
-TDesign UniApp 基于 Design Token 变量和媒体查询 `prefers-color-scheme` 实现了深色模式。默认情况下,每个组件自带了组件级别 light 样式变量,无需手动引入。如需使用深色模式,请按照以下步骤操作。
+TDesign Uniapp 基于 Design Token 变量和媒体查询 `prefers-color-scheme` 实现了深色模式。默认情况下,每个组件自带了组件级别 light 样式变量,无需手动引入。如需使用深色模式,请按照以下步骤操作。
## 使用方式
diff --git a/packages/tdesign-uniapp/site/docs/faq.md b/packages/tdesign-uniapp/site/docs/faq.md
index c365f5cea..e44ef3e9f 100644
--- a/packages/tdesign-uniapp/site/docs/faq.md
+++ b/packages/tdesign-uniapp/site/docs/faq.md
@@ -6,7 +6,7 @@ spline: explain
## 写在前面
-TDesign UniApp 的实现原理,可以查看[这篇文章](https://juejin.cn/post/7571650164844068898)。
+TDesign Uniapp 的实现原理,可以查看[这篇文章](https://juejin.cn/post/7571650164844068898)。
### 外部样式类
diff --git a/packages/tdesign-uniapp/site/docs/getting-started.en-US.md b/packages/tdesign-uniapp/site/docs/getting-started.en-US.md
index 196b83e53..5f6992e55 100644
--- a/packages/tdesign-uniapp/site/docs/getting-started.en-US.md
+++ b/packages/tdesign-uniapp/site/docs/getting-started.en-US.md
@@ -1,6 +1,6 @@
---
title: Uni App
-description: TDesign UniApp is a UI component library for Uni App.
+description: TDesign Uniapp is a UI component library for Uni App.
spline: explain
---
@@ -8,7 +8,7 @@ spline: explain
- Starting with version 0.7.0, the npm package name for the TDesign UniApp component library has changed from tdesign-uniapp to @tdesign/uniapp.
+ Starting with version 0.7.0, the npm package name for the TDesign Uniapp component library has changed from tdesign-uniapp to @tdesign/uniapp.
## Preview
@@ -149,11 +149,11 @@ We provide a variety of out-of-the-box template projects to help you get started
| Template | Description | Preview |
| --- | --- | --- |
-| [TDesign UniApp Starter](https://github.com/TDesignOteam/tdesign-uniapp-starter/) | Vue3 + CLI Mode - General |
|
-| [TDesign UniApp Starter Apply](https://github.com/TDesignOteam/tdesign-uniapp-starter-apply/) | Vue3 + CLI Mode - Event Registration |
|
-| [TDesign UniApp Starter Vue3 HX](https://github.com/TDesignOteam/tdesign-uniapp-starter-vue3-hx/) | Vue3 + HBuilderX Mode |
|
-| [TDesign UniApp Starter Vue2 CLI](https://github.com/TDesignOteam/tdesign-uniapp-starter-vue2-cli/) | Vue2 + CLI Mode |
|
-| [TDesign UniApp Starter Vue2 HX](https://github.com/TDesignOteam/tdesign-uniapp-starter-vue2-hx/) | Vue2 + HBuilderX Mode |
|
+| [TDesign Uniapp Starter](https://github.com/TDesignOteam/tdesign-uniapp-starter/) | Vue3 + CLI Mode - General |
|
+| [TDesign Uniapp Starter Apply](https://github.com/TDesignOteam/tdesign-uniapp-starter-apply/) | Vue3 + CLI Mode - Event Registration |
|
+| [TDesign Uniapp Starter Vue3 HX](https://github.com/TDesignOteam/tdesign-uniapp-starter-vue3-hx/) | Vue3 + HBuilderX Mode |
|
+| [TDesign Uniapp Starter Vue2 CLI](https://github.com/TDesignOteam/tdesign-uniapp-starter-vue2-cli/) | Vue2 + CLI Mode |
|
+| [TDesign Uniapp Starter Vue2 HX](https://github.com/TDesignOteam/tdesign-uniapp-starter-vue2-hx/) | Vue2 + HBuilderX Mode |
|
## Development
diff --git a/packages/tdesign-uniapp/site/docs/getting-started.md b/packages/tdesign-uniapp/site/docs/getting-started.md
index 5bcadd4e8..29a8678e3 100644
--- a/packages/tdesign-uniapp/site/docs/getting-started.md
+++ b/packages/tdesign-uniapp/site/docs/getting-started.md
@@ -1,6 +1,6 @@
---
title: Uni App
-description: TDesign UniApp 组件库。
+description: TDesign Uniapp 组件库。
spline: explain
---
@@ -8,7 +8,7 @@ spline: explain
- TDesign UniApp 组件库 npm 包名自 0.7.0 版本开始,从 tdesign-uniapp 变更为 @tdesign/uniapp
+ TDesign Uniapp 组件库 npm 包名自 0.7.0 版本开始,从 tdesign-uniapp 变更为 @tdesign/uniapp
## 预览
@@ -149,11 +149,11 @@ import TLoading from '@tdesign/uniapp/loading/loading.vue';
| 模板 | 描述 | 预览 |
| --- | --- | --- |
-| [TDesign UniApp Starter](https://github.com/TDesignOteam/tdesign-uniapp-starter/) | Vue3 + CLI 模式模板 - 通用类 |
|
-| [TDesign UniApp Starter Apply](https://github.com/TDesignOteam/tdesign-uniapp-starter-apply/) | Vue3 + CLI 模式模板 - 活动报名 |
|
-| [TDesign UniApp Starter Vue3 HX](https://github.com/TDesignOteam/tdesign-uniapp-starter-vue3-hx/) | Vue3 + HBuilderX 模式模板 |
|
-| [TDesign UniApp Starter Vue2 CLI](https://github.com/TDesignOteam/tdesign-uniapp-starter-vue2-cli/) | Vue2 + CLI 模式模板 |
|
-| [TDesign UniApp Starter Vue2 HX](https://github.com/TDesignOteam/tdesign-uniapp-starter-vue2-hx/) | Vue2 + HBuilderX 模式模板 |
|
+| [TDesign Uniapp Starter](https://github.com/TDesignOteam/tdesign-uniapp-starter/) | Vue3 + CLI 模式模板 - 通用类 |
|
+| [TDesign Uniapp Starter Apply](https://github.com/TDesignOteam/tdesign-uniapp-starter-apply/) | Vue3 + CLI 模式模板 - 活动报名 |
|
+| [TDesign Uniapp Starter Vue3 HX](https://github.com/TDesignOteam/tdesign-uniapp-starter-vue3-hx/) | Vue3 + HBuilderX 模式模板 |
|
+| [TDesign Uniapp Starter Vue2 CLI](https://github.com/TDesignOteam/tdesign-uniapp-starter-vue2-cli/) | Vue2 + CLI 模式模板 |
|
+| [TDesign Uniapp Starter Vue2 HX](https://github.com/TDesignOteam/tdesign-uniapp-starter-vue2-hx/) | Vue2 + HBuilderX 模式模板 |
|
## 开发
diff --git a/packages/tdesign-uniapp/site/web/stackblitz/content.ts b/packages/tdesign-uniapp/site/web/stackblitz/content.ts
index dab1ea2ed..4b2d7d108 100644
--- a/packages/tdesign-uniapp/site/web/stackblitz/content.ts
+++ b/packages/tdesign-uniapp/site/web/stackblitz/content.ts
@@ -42,7 +42,7 @@ export function createApp() {
`;
export const MANIFEST_JSON_CONTENT = JSON.stringify({
- name: 'TDesign UniApp',
+ name: 'TDesign Uniapp',
appid: '',
description: '',
versionName: '1.0.0',
@@ -111,7 +111,7 @@ export const PAGES_JSON_CONTENT = JSON.stringify({
{
path: 'pages/index/index',
style: {
- navigationBarTitleText: 'TDesign UniApp',
+ navigationBarTitleText: 'TDesign Uniapp',
},
},
],
From ee2b92c21022d50239ccb14a396113cc0b26a1cb Mon Sep 17 00:00:00 2001
From: novlan1 <1576271227@qq.com>
Date: Sat, 13 Jun 2026 01:44:05 +0800
Subject: [PATCH 03/11] feat(cascader): support filter
---
.../cascader/README.en-US.md | 3 +
packages/uniapp-components/cascader/README.md | 3 +
.../cascader/_example/cascader.vue | 6 +
.../cascader/_example/filterable/index.vue | 140 ++++++
.../uniapp-components/cascader/cascader.less | 48 ++
.../uniapp-components/cascader/cascader.vue | 409 ++++++++++++++----
packages/uniapp-components/cascader/props.ts | 13 +-
packages/uniapp-components/cascader/type.ts | 24 +-
8 files changed, 566 insertions(+), 80 deletions(-)
create mode 100644 packages/uniapp-components/cascader/_example/filterable/index.vue
diff --git a/packages/uniapp-components/cascader/README.en-US.md b/packages/uniapp-components/cascader/README.en-US.md
index e0c4f2c50..f03d32863 100644
--- a/packages/uniapp-components/cascader/README.en-US.md
+++ b/packages/uniapp-components/cascader/README.en-US.md
@@ -9,6 +9,9 @@ name | type | default | description | required
custom-style | Object | - | CSS(Cascading Style Sheets) | N
check-strictly | Boolean | false | \- | N
close-btn | Boolean | true | \- | N
+filter | Function | - | Typescript: `CascaderFilterFunction ` `type CascaderFilterFunction = (keyword: string, option: CascaderOption, path: CascaderOption[]) => boolean`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/common/common.ts)。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/cascader/type.ts) | N
+filter-placeholder | String | - | \- | N
+filterable | Boolean | false | \- | N
keys | Object | - | Typescript: `CascaderKeysType` `type CascaderKeysType = TreeKeysType`。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/common/common.ts)。[see more ts definition](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/cascader/type.ts) | N
options | Array | [] | Typescript: `Array` | N
placeholder | String | - | \- | N
diff --git a/packages/uniapp-components/cascader/README.md b/packages/uniapp-components/cascader/README.md
index 288a69674..441ea1494 100644
--- a/packages/uniapp-components/cascader/README.md
+++ b/packages/uniapp-components/cascader/README.md
@@ -51,6 +51,9 @@ import TCascader from '@tdesign/uniapp/cascader/cascader.vue';
custom-style | Object | - | 自定义样式 | N
check-strictly | Boolean | false | 父子节点选中状态不再关联,可各自选中或取消 | N
close-btn | Boolean | true | 关闭按钮 | N
+filter | Function | - | 自定义过滤函数。返回 true 表示匹配,未设置时使用内置匹配规则:对路径中所有 label 拼接后做大小写不敏感的 includes 匹配。TS 类型:`CascaderFilterFunction ` `type CascaderFilterFunction = (keyword: string, option: CascaderOption, path: CascaderOption[]) => boolean`。[通用类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/common/common.ts)。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/cascader/type.ts) | N
+filter-placeholder | String | - | 搜索框占位符描述文本 | N
+filterable | Boolean | false | 是否可搜索,开启后顶部会展示一个搜索框 | N
keys | Object | - | 用来定义 value / label / children / disabled 在 `options` 中对应的字段别名。TS 类型:`CascaderKeysType` `type CascaderKeysType = TreeKeysType`。[通用类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/common/common.ts)。[详细类型定义](https://github.com/tencent/tdesign-miniprogram/blob/develop/packages/uniapp-components/cascader/type.ts) | N
options | Array | [] | 可选项数据源。TS 类型:`Array` | N
placeholder | String | - | 未选中时的提示文案。组件内置默认值为:'选择选项' | N
diff --git a/packages/uniapp-components/cascader/_example/cascader.vue b/packages/uniapp-components/cascader/_example/cascader.vue
index d20c6e32d..a3440b9c3 100644
--- a/packages/uniapp-components/cascader/_example/cascader.vue
+++ b/packages/uniapp-components/cascader/_example/cascader.vue
@@ -36,6 +36,10 @@
+
+
+
+
@@ -43,6 +47,7 @@
+
diff --git a/packages/uniapp-components/cascader/cascader.less b/packages/uniapp-components/cascader/cascader.less
index 66f5e1b05..df8b9f6fc 100644
--- a/packages/uniapp-components/cascader/cascader.less
+++ b/packages/uniapp-components/cascader/cascader.less
@@ -12,6 +12,15 @@
@cascader-border-color: var(--td-cascader-border-color, @component-stroke);
@cascader-content-height: var(--td-cascader-content-height, 78vh);
@cascader-options-height: var(--td-cascader-options-height, calc(100% - @cascader-step-height));
+// filter (search)
+@cascader-filter-padding: var(--td-cascader-filter-padding, 0 @spacer-2 @spacer-1);
+@cascader-filter-item-padding: var(--td-cascader-filter-item-padding, 24rpx 32rpx);
+@cascader-filter-item-color: var(--td-cascader-filter-item-color, @text-color-primary);
+@cascader-filter-item-hover-bg: var(--td-cascader-filter-item-hover-bg, @bg-color-secondarycontainer);
+@cascader-filter-item-disabled-color: var(--td-cascader-filter-item-disabled-color, @text-color-disabled);
+@cascader-filter-highlight-color: var(--td-cascader-filter-highlight-color, @brand-color);
+@cascader-filter-empty-color: var(--td-cascader-filter-empty-color, @text-color-placeholder);
+@cascader-filter-empty-padding: var(--td-cascader-filter-empty-padding, 96rpx @spacer-2);
// steps
@cascader-step-height: var(--td-cascader-step-height, 88rpx);
@cascader-step-dot-size: var(--td-cascader-step-dot-size, 16rpx);
@@ -116,4 +125,43 @@
margin-left: auto;
}
}
+
+ &__filter {
+ padding: @cascader-filter-padding;
+ box-sizing: border-box;
+
+ &-result {
+ flex: 1;
+ width: 100%;
+ box-sizing: border-box;
+ }
+
+ &-result-item {
+ padding: @cascader-filter-item-padding;
+ color: @cascader-filter-item-color;
+ font: @font-body-medium;
+ box-sizing: border-box;
+ .border(bottom, @cascader-border-color);
+
+ &--hover {
+ background-color: @cascader-filter-item-hover-bg;
+ }
+
+ &--disabled {
+ color: @cascader-filter-item-disabled-color;
+ }
+ }
+
+ &-highlight {
+ color: @cascader-filter-highlight-color;
+ font-weight: 600;
+ }
+
+ &-empty {
+ padding: @cascader-filter-empty-padding;
+ text-align: center;
+ color: @cascader-filter-empty-color;
+ font: @font-body-medium;
+ }
+ }
}
diff --git a/packages/uniapp-components/cascader/cascader.vue b/packages/uniapp-components/cascader/cascader.vue
index 4349cedb1..d2cc6acae 100644
--- a/packages/uniapp-components/cascader/cascader.vue
+++ b/packages/uniapp-components/cascader/cascader.vue
@@ -33,99 +33,145 @@
-
-
+
+
+
+
+
+
onStepClick(index)"
+ v-if="theme == 'step'"
+ :class="classPrefix + '__steps'"
>
onStepClick(index)"
+ >
+
-
-
- {{ item }}
+ '__step-dot ' +
+ classPrefix +
+ '__step-dot--' +
+ (item !== placeholder ? 'active' : '') +
+ ' ' +
+ classPrefix +
+ '__step-dot--' +
+ (index === steps.length - 1 ? 'last' : '')
+ "
+ />
+
+
+ {{ item }}
+
+
+
+
- onTabChange(value)"
+ >
+
-
+
+
+
+
+
+
+ {{ subTitles[stepIndex] }}
- onTabChange(value)"
+
-
-
+ :class="classPrefix + '__options'"
+ scroll-y
+ :scroll-top="scrollTopList[index]"
+ type="list"
+ :style="'height: ' + optionsHeight + 'px'"
+ >
+
+ handleSelect(e, { level: index, value: e.value })"
+ />
+
+
+
-
-
-
- {{ subTitles[stepIndex] }}
-
-
-
+
-
- handleSelect(e, { level: index, value: e.value })"
- />
+ onFilterResultTap(item.key)"
+ >
+
+ {{ frag.text }}
+
-
+
+ {{ globalConfig.empty }}
+
+
@@ -134,12 +180,13 @@
+
+
diff --git a/packages/uniapp-components/paragraph/_example/combination/index.vue b/packages/uniapp-components/paragraph/_example/combination/index.vue
new file mode 100644
index 000000000..66e55b7ef
--- /dev/null
+++ b/packages/uniapp-components/paragraph/_example/combination/index.vue
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+ TDesign features a unified design values, consistent design language, and visual style, helping users form
+ continuous and coherent perceptions of the experience.
+
+ Based on this, TDesign offers out-typography-of-the-box UI component libraries, design guidelines, and design
+ assets, elegantly and efficiently freeing design and development from repetitive tasks. Simultaneously, it
+ facilitates easy extension on top of TDesign, enabling a better alignment with business requirements.
+
+
+
+ Comprehensive
+
+
+ TDesign Support
+
+ Vue 2
+ ,
+
+ Vue 3
+ ,
+
+ React
+
+ components for Desktop Application and
+
+ Vue 3
+ ,
+
+ Wechat MiniProgram
+
+ components for Mobile Application.
+
+
+ • Features
+ • Comprehensive
+
+ • Consistency
+
+
+ • Usability
+
+ • Join TDesign
+
+
+ 1. Features
+ 2. Comprehensive
+
+ 1. Consistency
+
+
+ 2. Usability
+
+ 3. Join TDesign
+
+
+
+
+
+
+
+
diff --git a/packages/uniapp-components/paragraph/_example/copyable/index.vue b/packages/uniapp-components/paragraph/_example/copyable/index.vue
new file mode 100644
index 000000000..de4776794
--- /dev/null
+++ b/packages/uniapp-components/paragraph/_example/copyable/index.vue
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/uniapp-components/paragraph/_example/ellipsis/index.vue b/packages/uniapp-components/paragraph/_example/ellipsis/index.vue
new file mode 100644
index 000000000..9f6a0aa93
--- /dev/null
+++ b/packages/uniapp-components/paragraph/_example/ellipsis/index.vue
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/uniapp-components/paragraph/_example/paragraph.less b/packages/uniapp-components/paragraph/_example/paragraph.less
new file mode 100644
index 000000000..1af7bc8bf
--- /dev/null
+++ b/packages/uniapp-components/paragraph/_example/paragraph.less
@@ -0,0 +1,27 @@
+.typography-example {
+ display: flex;
+ padding: 0 32rpx;
+ background-color: var(--bg-color-demo, #fff);
+
+ &--inline {
+ display: inline-block;
+ }
+
+ &--theme {
+ gap: 24px;
+ }
+
+ &--border {
+ position: relative;
+
+ &::after {
+ content: '';
+ position: absolute;
+ bottom: 0;
+ left: 16px;
+ right: 16px;
+ border-bottom: 1px solid var(--td-stroke-color, #e7e7e7);
+ transform: scaleY(0.5);
+ }
+ }
+}
diff --git a/packages/uniapp-components/paragraph/_example/paragraph.vue b/packages/uniapp-components/paragraph/_example/paragraph.vue
new file mode 100644
index 000000000..be7a1959a
--- /dev/null
+++ b/packages/uniapp-components/paragraph/_example/paragraph.vue
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/uniapp-components/paragraph/_example/theme/index.vue b/packages/uniapp-components/paragraph/_example/theme/index.vue
new file mode 100644
index 000000000..81a3ea005
--- /dev/null
+++ b/packages/uniapp-components/paragraph/_example/theme/index.vue
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/uniapp-components/paragraph/computed.js b/packages/uniapp-components/paragraph/computed.js
new file mode 100644
index 000000000..19415b33e
--- /dev/null
+++ b/packages/uniapp-components/paragraph/computed.js
@@ -0,0 +1,42 @@
+/* typography 公共计算逻辑 */
+
+/* 计算省略内容的内联样式 */
+export function ellipsisStyle(ellipsis, isExpanded) {
+ if (!ellipsis || isExpanded) return '';
+ const row = typeof ellipsis === 'object' && ellipsis.row ? ellipsis.row : 1;
+ return (
+ `overflow:hidden;text-overflow:ellipsis;white-space:normal;display:-webkit-box;-webkit-line-clamp:${
+ row
+ };-webkit-box-orient:vertical;`
+ );
+}
+
+/* 计算外层容器 class */
+export function wrapperClass(classPrefix, ellipsis) {
+ if (ellipsis) {
+ return `${classPrefix}__ellipsis-wrapper`;
+ }
+ return '';
+}
+
+/* 根据装饰属性拼接内层 class */
+export function decorClass(classPrefix, strong, underline, del, code, mark, keyboard, italic) {
+ const list = [];
+ if (strong) list.push(`${classPrefix}--strong`);
+ if (underline) list.push(`${classPrefix}--underline`);
+ if (del) list.push(`${classPrefix}--delete`);
+ if (code) list.push(`${classPrefix}--code`);
+ if (mark) list.push(`${classPrefix}--mark`);
+ if (keyboard) list.push(`${classPrefix}--keyboard`);
+ if (italic) list.push(`${classPrefix}--italic`);
+ return list.join(' ');
+}
+
+/* mark 自定义颜色 */
+export function markStyle(mark) {
+ if (!mark || mark === true || mark === 'true') return '';
+ if (mark && mark !== 'false' && mark !== false) {
+ return `background-color:${mark};`;
+ }
+ return '';
+}
diff --git a/packages/uniapp-components/paragraph/paragraph.less b/packages/uniapp-components/paragraph/paragraph.less
new file mode 100644
index 000000000..244f2cd93
--- /dev/null
+++ b/packages/uniapp-components/paragraph/paragraph.less
@@ -0,0 +1,168 @@
+@import '../common/style/base.less';
+
+@typography-text-primary-color: @text-color-primary;
+@typography-text-secondary-color: @text-color-secondary;
+@typography-text-disabled-color: @text-color-disabled;
+@typography-text-success-color: @success-color;
+@typography-text-error-color: @error-color;
+@typography-text-warning-color: @warning-color;
+@typography-text-mark-color: #fcdf47;
+@typography-icon-color: @brand-color;
+
+@typography-text-strong: 600;
+
+@typography-text-font: @font-body-medium;
+@typography-code-font: @font-body-small;
+@typography-h1-font: @font-headline-large;
+@typography-h2-font: @font-headline-medium;
+@typography-h3-font: @font-headline-small;
+@typography-h4-font: @font-title-large;
+@typography-h5-font: @font-title-medium;
+@typography-h6-font: @font-title-small;
+
+@typography-code-family:
+ Source Code Pro,
+ -apple-system,
+ BlinkMacSystemFont,
+ Segoe UI,
+ Roboto,
+ Hiragino Sans GB,
+ Microsoft YaHei UI,
+ Microsoft YaHei;
+
+// ==================== 主样式 ====================
+.@{prefix}-typography {
+ color: @typography-text-primary-color;
+ font: @font-body-medium;
+ margin: @spacer-2 0;
+
+ &--h1 {
+ font: @typography-h1-font;
+ margin-top: @spacer-4;
+ margin-bottom: @spacer-3;
+ }
+
+ &--h2 {
+ font: @typography-h2-font;
+ margin-top: @spacer-4;
+ margin-bottom: @spacer-3;
+ }
+
+ &--h3 {
+ font: @typography-h3-font;
+ margin-top: @spacer-4;
+ margin-bottom: @spacer-2;
+ }
+
+ &--h4 {
+ font: @typography-h4-font;
+ margin-top: @spacer-3;
+ margin-bottom: @spacer-2;
+ }
+
+ &--h5 {
+ font: @typography-h5-font;
+ margin-top: @spacer-3;
+ margin-bottom: @spacer-2;
+ }
+
+ &--h6 {
+ font: @typography-h6-font;
+ }
+
+ &--strong {
+ font-weight: @typography-text-strong;
+ }
+
+ &--mark {
+ background-color: @typography-text-mark-color;
+ }
+
+ &--code {
+ border-radius: @radius-default;
+ border: 1px solid @component-border;
+ margin: 0 @spacer;
+ background-color: @bg-color-secondarycontainer;
+ padding: 0 @spacer;
+ transition: background-color 0.2s;
+ white-space: nowrap;
+ font: @typography-code-font;
+ font-family: @typography-code-family;
+ display: inline-block;
+ }
+
+ &--keyboard {
+ border-radius: @radius-default;
+ border: 1px solid @component-border;
+ margin: 0 calc(@spacer / 2);
+ background-color: @bg-color-secondarycontainer;
+ padding: 0 @spacer;
+ box-shadow: 0 1px 0 0 @component-border;
+ font: @typography-code-font;
+ font-family: @typography-code-family;
+ display: inline-block;
+ }
+
+ &--disabled {
+ color: @typography-text-disabled-color;
+ cursor: not-allowed;
+ }
+
+ &--success {
+ color: @typography-text-success-color;
+ }
+
+ &--warning {
+ color: @typography-text-warning-color;
+ }
+
+ &--error {
+ color: @typography-text-error-color;
+ }
+
+ &--secondary {
+ color: @typography-text-secondary-color;
+ }
+
+ &-ellipsis-symbol {
+ color: @typography-icon-color;
+ cursor: pointer;
+ text-decoration: none;
+ white-space: nowrap;
+ flex: 1;
+ }
+
+ &--italic {
+ font-style: italic;
+ }
+
+ &--underline {
+ text-decoration: underline;
+ }
+
+ &--delete {
+ text-decoration: line-through;
+ }
+
+ &__ellipsis-wrapper {
+ display: flex;
+ align-items: flex-end;
+ }
+
+ &__ellipsis-content {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: normal;
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ }
+
+ &__copy {
+ display: inline-flex;
+ align-items: center;
+ margin-left: 16rpx;
+ flex-shrink: 0;
+ color: @typography-icon-color;
+ cursor: pointer;
+ }
+}
diff --git a/packages/uniapp-components/paragraph/paragraph.vue b/packages/uniapp-components/paragraph/paragraph.vue
new file mode 100644
index 000000000..cc8149ac7
--- /dev/null
+++ b/packages/uniapp-components/paragraph/paragraph.vue
@@ -0,0 +1,105 @@
+
+
+
+
+ {{ content }}
+
+
+
+
+
+ {{ content }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ globalConfig.expandText }}
+
+
+ {{ globalConfig.collapseText }}
+
+
+
+
+
+
diff --git a/packages/uniapp-components/paragraph/props.ts b/packages/uniapp-components/paragraph/props.ts
new file mode 100644
index 000000000..e6ca51080
--- /dev/null
+++ b/packages/uniapp-components/paragraph/props.ts
@@ -0,0 +1,18 @@
+/* eslint-disable */
+
+/**
+ * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
+ * */
+
+import type { TdParagraphProps } from './type';
+export default {
+ /** 段落内容 */
+ content: {
+ type: String,
+ },
+ /** 是否省略展示,可通过配置参数自定义省略操作的具体功能和样式 */
+ ellipsis: {
+ type: [Boolean, Object],
+ default: false as TdParagraphProps['ellipsis'],
+ },
+};
diff --git a/packages/uniapp-components/paragraph/type.ts b/packages/uniapp-components/paragraph/type.ts
new file mode 100644
index 000000000..757697e1d
--- /dev/null
+++ b/packages/uniapp-components/paragraph/type.ts
@@ -0,0 +1,19 @@
+/* eslint-disable */
+
+/**
+ * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
+ * */
+
+import type { TypographyEllipsis } from '../text/type';
+
+export interface TdParagraphProps {
+ /**
+ * 段落内容
+ */
+ content?: string;
+ /**
+ * 是否省略展示,可通过配置参数自定义省略操作的具体功能和样式
+ * @default false
+ */
+ ellipsis?: boolean | TypographyEllipsis;
+}
diff --git a/packages/uniapp-components/text/props.ts b/packages/uniapp-components/text/props.ts
new file mode 100644
index 000000000..ce93987f0
--- /dev/null
+++ b/packages/uniapp-components/text/props.ts
@@ -0,0 +1,50 @@
+/* eslint-disable */
+
+/**
+ * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
+ * */
+
+import type { TdTextProps } from './type';
+export default {
+ /** 是否添加代码样式 */
+ code: Boolean,
+ /** 文本内容 */
+ content: {
+ type: String,
+ },
+ /** 是否可复制 */
+ copyable: {
+ type: [Boolean, Object],
+ default: false as TdTextProps['copyable'],
+ },
+ /** 是否添加删除线样式 */
+ delete: Boolean,
+ /** 是否添加不可用样式 */
+ disabled: Boolean,
+ /** 是否省略展示,可通过配置参数自定义省略操作的具体功能和样式 */
+ ellipsis: {
+ type: [Boolean, Object],
+ default: false as TdTextProps['ellipsis'],
+ },
+ /** 文本是否为斜体 */
+ italic: Boolean,
+ /** 是否添加键盘样式 */
+ keyboard: Boolean,
+ /** 是否添加标记样式,默认为黄色,可通过配置颜色修改标记样式,如#0052D9 */
+ mark: {
+ type: [String, Boolean],
+ default: false as TdTextProps['mark'],
+ },
+ /** 文本是否加粗 */
+ strong: Boolean,
+ /** 主题 */
+ theme: {
+ type: String,
+ validator(val: TdTextProps['theme']): boolean {
+ if (!val) return true;
+ return ['primary', 'secondary', 'success', 'warning', 'error'].includes(val);
+ },
+ },
+ /** 是否添加下划线样式 */
+ underline: Boolean,
+};
diff --git a/packages/uniapp-components/text/text.less b/packages/uniapp-components/text/text.less
new file mode 100644
index 000000000..d20abff77
--- /dev/null
+++ b/packages/uniapp-components/text/text.less
@@ -0,0 +1 @@
+@import '../paragraph/paragraph.less';
diff --git a/packages/uniapp-components/text/text.vue b/packages/uniapp-components/text/text.vue
new file mode 100644
index 000000000..cfd3481bf
--- /dev/null
+++ b/packages/uniapp-components/text/text.vue
@@ -0,0 +1,175 @@
+
+
+
+
+ {{ content }}
+
+
+
+
+
+
+ {{ content }}
+
+
+
+
+
+
+
+ {{ globalConfig.expandText }}
+
+
+ {{ globalConfig.collapseText }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/uniapp-components/text/type.ts b/packages/uniapp-components/text/type.ts
new file mode 100644
index 000000000..fa2014004
--- /dev/null
+++ b/packages/uniapp-components/text/type.ts
@@ -0,0 +1,78 @@
+/* eslint-disable */
+
+/**
+ * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
+ * */
+
+export interface TdTextProps {
+ /**
+ * 是否添加代码样式
+ * @default false
+ */
+ code?: boolean;
+ /**
+ * 文本内容
+ */
+ content?: string;
+ /**
+ * 是否可复制
+ * @default false
+ */
+ copyable?: boolean | TypographyCopyable;
+ /**
+ * 是否添加删除线样式
+ * @default false
+ */
+ delete?: boolean;
+ /**
+ * 是否添加不可用样式
+ * @default false
+ */
+ disabled?: boolean;
+ /**
+ * 是否省略展示,可通过配置参数自定义省略操作的具体功能和样式
+ * @default false
+ */
+ ellipsis?: boolean | TypographyEllipsis;
+ /**
+ * 文本是否为斜体
+ * @default false
+ */
+ italic?: boolean;
+ /**
+ * 是否添加键盘样式
+ * @default false
+ */
+ keyboard?: boolean;
+ /**
+ * 是否添加标记样式,默认为黄色,可通过配置颜色修改标记样式,如#0052D9
+ * @default false
+ */
+ mark?: string | boolean;
+ /**
+ * 文本是否加粗
+ * @default false
+ */
+ strong?: boolean;
+ /**
+ * 主题
+ */
+ theme?: 'primary' | 'secondary' | 'success' | 'warning' | 'error';
+ /**
+ * 是否添加下划线样式
+ * @default false
+ */
+ underline?: boolean;
+}
+
+export interface TypographyCopyable {
+ text?: string;
+ suffix?: boolean;
+}
+
+export interface TypographyEllipsis {
+ collapsible?: boolean;
+ expandable?: boolean;
+ row?: number;
+ suffix?: boolean;
+}
diff --git a/packages/uniapp-components/title/props.ts b/packages/uniapp-components/title/props.ts
new file mode 100644
index 000000000..a615830b8
--- /dev/null
+++ b/packages/uniapp-components/title/props.ts
@@ -0,0 +1,27 @@
+/* eslint-disable */
+
+/**
+ * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
+ * */
+
+import type { TdTitleProps } from './type';
+export default {
+ /** 段落内容 */
+ content: {
+ type: String,
+ },
+ /** 是否省略展示,可通过配置参数自定义省略操作的具体功能和样式 */
+ ellipsis: {
+ type: [Boolean, Object],
+ default: false as TdTitleProps['ellipsis'],
+ },
+ /** 标题等级 */
+ level: {
+ type: String,
+ default: 'h1' as TdTitleProps['level'],
+ validator(val: TdTitleProps['level']): boolean {
+ if (!val) return true;
+ return ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(val);
+ },
+ },
+};
diff --git a/packages/uniapp-components/title/title.less b/packages/uniapp-components/title/title.less
new file mode 100644
index 000000000..d20abff77
--- /dev/null
+++ b/packages/uniapp-components/title/title.less
@@ -0,0 +1 @@
+@import '../paragraph/paragraph.less';
diff --git a/packages/uniapp-components/title/title.vue b/packages/uniapp-components/title/title.vue
new file mode 100644
index 000000000..fd3dbd164
--- /dev/null
+++ b/packages/uniapp-components/title/title.vue
@@ -0,0 +1,94 @@
+
+
+
+
+ {{ content }}
+
+
+
+
+
+ {{ content }}
+
+
+
+
+
+ {{ globalConfig.expandText }}
+
+
+ {{ globalConfig.collapseText }}
+
+
+
+
+
diff --git a/packages/uniapp-components/title/type.ts b/packages/uniapp-components/title/type.ts
new file mode 100644
index 000000000..06df8fdd9
--- /dev/null
+++ b/packages/uniapp-components/title/type.ts
@@ -0,0 +1,24 @@
+/* eslint-disable */
+
+/**
+ * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
+ * */
+
+import type { TypographyEllipsis } from '../text/type';
+
+export interface TdTitleProps {
+ /**
+ * 段落内容
+ */
+ content?: string;
+ /**
+ * 是否省略展示,可通过配置参数自定义省略操作的具体功能和样式
+ * @default false
+ */
+ ellipsis?: boolean | TypographyEllipsis;
+ /**
+ * 标题等级
+ * @default h1
+ */
+ level?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
+}
From 5bb7fe7100d5621eb7437f1042a808c7eb02fc5a Mon Sep 17 00:00:00 2001
From: novlan1 <1576271227@qq.com>
Date: Sat, 13 Jun 2026 12:04:38 +0800
Subject: [PATCH 09/11] chore: add text/title/paragraph types
---
packages/tdesign-uniapp-chat/package.json | 2 +-
.../example/script/types/index.js | 35 +++++++++++++++++++
packages/tdesign-uniapp/global.d.ts | 3 ++
packages/tdesign-uniapp/package.json | 17 ++++++++-
packages/uniapp-components/types/index.d.ts | 3 ++
.../uniapp-components/types/paragraph.d.ts | 7 ++++
packages/uniapp-components/types/text.d.ts | 7 ++++
packages/uniapp-components/types/title.d.ts | 7 ++++
8 files changed, 79 insertions(+), 2 deletions(-)
create mode 100644 packages/uniapp-components/types/paragraph.d.ts
create mode 100644 packages/uniapp-components/types/text.d.ts
create mode 100644 packages/uniapp-components/types/title.d.ts
diff --git a/packages/tdesign-uniapp-chat/package.json b/packages/tdesign-uniapp-chat/package.json
index 845a3bd4c..c3dba1ef7 100644
--- a/packages/tdesign-uniapp-chat/package.json
+++ b/packages/tdesign-uniapp-chat/package.json
@@ -145,4 +145,4 @@
"eslint --fix"
]
}
-}
\ No newline at end of file
+}
diff --git a/packages/tdesign-uniapp/example/script/types/index.js b/packages/tdesign-uniapp/example/script/types/index.js
index ff9c634e1..4cfb82121 100644
--- a/packages/tdesign-uniapp/example/script/types/index.js
+++ b/packages/tdesign-uniapp/example/script/types/index.js
@@ -1,3 +1,4 @@
+const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');
@@ -117,6 +118,37 @@ function checkFileExists(filePath, label) {
}
}
+function runEslintFix(targets, label) {
+ // 过滤掉不存在的路径,避免 eslint 直接报错退出
+ const existing = targets.filter(p => fs.existsSync(p));
+ if (existing.length === 0) {
+ console.warn(`[types][${label}] 跳过 eslint --fix: 无可处理的目标文件`);
+ return;
+ }
+
+ const args = [
+ 'eslint',
+ '--fix',
+ '--no-error-on-unmatched-pattern',
+ '--ext',
+ '.ts,.d.ts',
+ ...existing.map(p => `"${p}"`),
+ ].join(' ');
+
+ console.log(`[types][${label}] 执行 eslint --fix 处理 ${existing.length} 个目标...`);
+ try {
+ execSync(`npx ${args}`, {
+ cwd: PROJECT_ROOT,
+ stdio: 'inherit',
+ });
+ console.log(`[types][${label}] eslint --fix 完成 ✅`);
+ } catch (err) {
+ // eslint 在仅有 warning(或个别非 --fix 可处理的 error)时也会非零退出,
+ // 不应阻断生成流程,仅打印提示
+ console.warn(`[types][${label}] eslint --fix 退出码非零(可能存在无法自动修复的问题,请手动检查)`);
+ }
+}
+
async function genOnProject({
pkgGlob,
pkgJsonPath,
@@ -158,6 +190,9 @@ async function genOnProject({
genIndexContent(fileNames, indexPath, isChat, label);
getGlobalDTS(fileNames, globalDTSPath, isChat, label);
+ // 对生成的文件自动执行 eslint --fix,避免再手动跑 lint
+ runEslintFix([dtsDir, globalDTSPath], label);
+
console.log(`[types][${label}] 生成完毕 ✅`);
}
diff --git a/packages/tdesign-uniapp/global.d.ts b/packages/tdesign-uniapp/global.d.ts
index 4aff571c7..6059de61e 100644
--- a/packages/tdesign-uniapp/global.d.ts
+++ b/packages/tdesign-uniapp/global.d.ts
@@ -45,6 +45,7 @@ declare module 'vue' {
TNavbar: typeof import('@tdesign/uniapp/navbar/navbar.vue').default;
TNoticeBar: typeof import('@tdesign/uniapp/notice-bar/notice-bar.vue').default;
TOverlay: typeof import('@tdesign/uniapp/overlay/overlay.vue').default;
+ TParagraph: typeof import('@tdesign/uniapp/paragraph/paragraph.vue').default;
TPicker: typeof import('@tdesign/uniapp/picker/picker.vue').default;
TPickerItem: typeof import('@tdesign/uniapp/picker-item/picker-item.vue').default;
TPopover: typeof import('@tdesign/uniapp/popover/popover.vue').default;
@@ -77,7 +78,9 @@ declare module 'vue' {
TTable: typeof import('@tdesign/uniapp/table/table.vue').default;
TTabs: typeof import('@tdesign/uniapp/tabs/tabs.vue').default;
TTag: typeof import('@tdesign/uniapp/tag/tag.vue').default;
+ TText: typeof import('@tdesign/uniapp/text/text.vue').default;
TTextarea: typeof import('@tdesign/uniapp/textarea/textarea.vue').default;
+ TTitle: typeof import('@tdesign/uniapp/title/title.vue').default;
TToast: typeof import('@tdesign/uniapp/toast/toast.vue').default;
TTreeSelect: typeof import('@tdesign/uniapp/tree-select/tree-select.vue').default;
TUpload: typeof import('@tdesign/uniapp/upload/upload.vue').default;
diff --git a/packages/tdesign-uniapp/package.json b/packages/tdesign-uniapp/package.json
index 84e04ec57..6436c8307 100644
--- a/packages/tdesign-uniapp/package.json
+++ b/packages/tdesign-uniapp/package.json
@@ -309,6 +309,11 @@
"import": "./dist/overlay/overlay.vue",
"default": "./dist/overlay/overlay.vue"
},
+ "./paragraph/paragraph.vue": {
+ "types": "./dist/types/paragraph.d.ts",
+ "import": "./dist/paragraph/paragraph.vue",
+ "default": "./dist/paragraph/paragraph.vue"
+ },
"./picker/picker.vue": {
"types": "./dist/types/picker.d.ts",
"import": "./dist/picker/picker.vue",
@@ -469,11 +474,21 @@
"import": "./dist/tag/tag.vue",
"default": "./dist/tag/tag.vue"
},
+ "./text/text.vue": {
+ "types": "./dist/types/text.d.ts",
+ "import": "./dist/text/text.vue",
+ "default": "./dist/text/text.vue"
+ },
"./textarea/textarea.vue": {
"types": "./dist/types/textarea.d.ts",
"import": "./dist/textarea/textarea.vue",
"default": "./dist/textarea/textarea.vue"
},
+ "./title/title.vue": {
+ "types": "./dist/types/title.d.ts",
+ "import": "./dist/title/title.vue",
+ "default": "./dist/title/title.vue"
+ },
"./toast/toast.vue": {
"types": "./dist/types/toast.d.ts",
"import": "./dist/toast/toast.vue",
@@ -582,4 +597,4 @@
"eslint --fix"
]
}
-}
\ No newline at end of file
+}
diff --git a/packages/uniapp-components/types/index.d.ts b/packages/uniapp-components/types/index.d.ts
index aae6edc8f..1faadfeaf 100644
--- a/packages/uniapp-components/types/index.d.ts
+++ b/packages/uniapp-components/types/index.d.ts
@@ -42,6 +42,7 @@ export * from '../message/type';
export * from '../navbar/type';
export * from '../notice-bar/type';
export * from '../overlay/type';
+export * from '../paragraph/type';
export * from '../picker/type';
export * from '../picker-item/type';
export * from '../popover/type';
@@ -74,7 +75,9 @@ export * from '../tab-panel/type';
export * from '../table/type';
export * from '../tabs/type';
export * from '../tag/type';
+export * from '../text/type';
export * from '../textarea/type';
+export * from '../title/type';
export * from '../toast/type';
export * from '../tree-select/type';
export * from '../upload/type';
diff --git a/packages/uniapp-components/types/paragraph.d.ts b/packages/uniapp-components/types/paragraph.d.ts
new file mode 100644
index 000000000..9e4fddcb8
--- /dev/null
+++ b/packages/uniapp-components/types/paragraph.d.ts
@@ -0,0 +1,7 @@
+import type { TransformEventHandlers, ExtractNonOnProps } from '../common/common';
+import type { TdParagraphProps } from '../paragraph/type';
+
+export type ParagraphProps = ExtractNonOnProps;
+export type ParagraphEmits = TransformEventHandlers;
+declare const ParagraphComponent: import('vue').DefineComponent;
+export default ParagraphComponent;
diff --git a/packages/uniapp-components/types/text.d.ts b/packages/uniapp-components/types/text.d.ts
new file mode 100644
index 000000000..2d499a8c3
--- /dev/null
+++ b/packages/uniapp-components/types/text.d.ts
@@ -0,0 +1,7 @@
+import type { TransformEventHandlers, ExtractNonOnProps } from '../common/common';
+import type { TdTextProps } from '../text/type';
+
+export type TextProps = ExtractNonOnProps;
+export type TextEmits = TransformEventHandlers;
+declare const TextComponent: import('vue').DefineComponent;
+export default TextComponent;
diff --git a/packages/uniapp-components/types/title.d.ts b/packages/uniapp-components/types/title.d.ts
new file mode 100644
index 000000000..0061d0797
--- /dev/null
+++ b/packages/uniapp-components/types/title.d.ts
@@ -0,0 +1,7 @@
+import type { TransformEventHandlers, ExtractNonOnProps } from '../common/common';
+import type { TdTitleProps } from '../title/type';
+
+export type TitleProps = ExtractNonOnProps;
+export type TitleEmits = TransformEventHandlers;
+declare const TitleComponent: import('vue').DefineComponent;
+export default TitleComponent;
From 7d24d29ec6c3cc496bc02b6e0fb800516d9c018d Mon Sep 17 00:00:00 2001
From: novlan1 <1576271227@qq.com>
Date: Sat, 13 Jun 2026 12:11:48 +0800
Subject: [PATCH 10/11] =?UTF-8?q?fix(image):=20=E4=BF=AE=E5=A4=8D=E9=B8=BF?=
=?UTF-8?q?=E8=92=99=E4=B8=8B=E5=9B=BE=E7=89=87=E6=97=A0=E6=B3=95=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/uniapp-components/common/version.js | 3 +++
packages/uniapp-components/image/image.vue | 4 ++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/packages/uniapp-components/common/version.js b/packages/uniapp-components/common/version.js
index 474e9b73e..3b913dee9 100644
--- a/packages/uniapp-components/common/version.js
+++ b/packages/uniapp-components/common/version.js
@@ -12,6 +12,9 @@ function getSystemInfo() {
// 版本号比较, 参考:https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html
export function compareVersion(v1, v2) {
+ if (!v1 || !v2) {
+ return 0;
+ }
v1 = v1.split('.');
v2 = v2.split('.');
const len = Math.max(v1.length, v2.length);
diff --git a/packages/uniapp-components/image/image.vue b/packages/uniapp-components/image/image.vue
index dfd61d352..1593da9dc 100644
--- a/packages/uniapp-components/image/image.vue
+++ b/packages/uniapp-components/image/image.vue
@@ -142,14 +142,14 @@ export default {
},
methods: {
onLoaded(e) {
- const version = appBaseInfo.SDKVersion;
const {
mode,
tId,
} = this;
- const lower = compareVersion(version, '2.10.3') < 0;
// #ifdef MP-WEIXIN || MP-QQ
+ const version = appBaseInfo.SDKVersion || '2.10.3';
+ const lower = compareVersion(version, '2.10.3') < 0;
if ('heightFix' === mode && lower) {
getRect(this, `#${tId || 'image'}`).then((e) => {
const {
From 26d2ae76bed39da07414e109dbb360a859c66326 Mon Sep 17 00:00:00 2001
From: tdesign-bot
Date: Mon, 15 Jun 2026 02:11:44 +0000
Subject: [PATCH 11/11] chore: stash changelog [ci skip]
---
packages/tdesign-uniapp/.changelog/pr-4511.md | 12 ++++++++++++
1 file changed, 12 insertions(+)
create mode 100644 packages/tdesign-uniapp/.changelog/pr-4511.md
diff --git a/packages/tdesign-uniapp/.changelog/pr-4511.md b/packages/tdesign-uniapp/.changelog/pr-4511.md
new file mode 100644
index 000000000..aaae886a0
--- /dev/null
+++ b/packages/tdesign-uniapp/.changelog/pr-4511.md
@@ -0,0 +1,12 @@
+---
+pr_number: 4511
+contributor: novlan1
+---
+
+- fix(Message): 修复连续点击时的报错问题 @novlan1 ([#4511](https://github.com/Tencent/tdesign-miniprogram/pull/4511))
+- fix(Stepper): 调整手动输入逻辑,输入时仅过滤非法字符,范围校验&赋值移至失焦 @novlan1 ([#4511](https://github.com/Tencent/tdesign-miniprogram/pull/4511))
+- fix(Search): 补全 `update:value` 事件声明,修复 `v-model:value` 语法糖告警 @novlan1 ([#4511](https://github.com/Tencent/tdesign-miniprogram/pull/4511))
+- fix(Upload): 修复禁用态文件样式错误(禁用态下移除操作按钮) @novlan1 ([#4511](https://github.com/Tencent/tdesign-miniprogram/pull/4511))
+- fix(Image): 修复鸿蒙下图片无法显示问题 @novlan1 ([#4511](https://github.com/Tencent/tdesign-miniprogram/pull/4511))
+- feat(Cascader): 新增 `filterable`、`filter` 和 `filter-placeholder` 属性,支持搜索功能 @novlan1 ([#4511](https://github.com/Tencent/tdesign-miniprogram/pull/4511))
+- feat(Typography): 新增 `Typography` 排版组件 @novlan1 ([#4511](https://github.com/Tencent/tdesign-miniprogram/pull/4511))