Repository: Tencent/tdesign-vue-next
Pull request #5581 (2025-06-09 16:21:02)

fix(cascader): fix value-type="full", value is undefined error
<!--
首先，感谢你的贡献！😄
请阅读并遵循 [TDesign 贡献指南](https://github.com/Tencent/tdesign/blob/main/docs/contributing.md)，填写以下 pull request 的信息。
PR 在维护者审核通过后会合并，谢谢！
-->

### 🤔 这个 PR 的性质是？

- [x] 日常 bug 修复
- [ ] 新特性提交
- [ ] 文档改进
- [ ] 演示代码改进
- [ ] 组件样式/交互改进
- [ ] CI/CD 改进
- [ ] 重构
- [ ] 代码风格优化
- [ ] 测试用例
- [ ] 分支合并
- [ ] 其他

### 🔗 相关 Issue

<!--
1. 描述相关需求的来源，如相关的 issue 讨论链接。
-->
https://github.com/Tencent/tdesign-vue-next/issues/5579
### 💡 需求背景和解决方案

<!--
1. 要解决的具体问题。
2. 列出最终的 API 实现和用法。
3. 涉及UI/交互变动需要有截图或 GIF。
-->

### 📝 更新日志

- [ ] 本条 PR 不需要纳入 Changelog

#### tdesign-vue-next
<!--
- feat(组件名称): 处理问题或特性描述
--> 
- fix(cascader): 修复 `value-type="full"` ，value 为 undefined时组件内部报错
#### @tdesign-vue-next/chat
<!--
- feat(组件名称): 处理问题或特性描述
--> 

### ☑️ 请求合并前的自查清单

⚠️ 请自检并全部**勾选全部选项**。⚠️

- [ ] 文档已补充或无须补充
- [ ] 代码演示已提供或无须提供
- [ ] TypeScript 定义已补充或无须补充
- [ ] Changelog 已提供或无须提供


tdesign-bot: # TDesign Component Site Preview [Open](https://github.com/Tencent/tdesign-vue-next/actions/runs/15539342483)
  | Component | Preview |
  | --------- | :--: |
  | tdesign-vue-next | [<img width="300" alt="完成" src="https://user-images.githubusercontent.com/15634204/150816437-9f5bb788-cd67-4cbc-9897-b82d74e9aa65.png" />](https://preview-pr-5581-tdesign-vue-next.surge.sh) | 
| @tdesign-vue-next/chat | [<img width="300" alt="完成" src="https://user-images.githubusercontent.com/15634204/150816437-9f5bb788-cd67-4cbc-9897-b82d74e9aa65.png" />](https://preview-pr-5581-tdesign-vue-next-chat.surge.sh) | 

  <!-- AUTO_PREVIEW_HOOK -->
<!-- AUTO_PREVIEW_HOOK -->
pkg-pr-new[bot]: 
[tdesign-vue-next-demo](https://pkg.pr.new/template/766020e4-dcac-42c8-87e2-d7ac727ee615)


```
npm i https://pkg.pr.new/Tencent/tdesign-vue-next@5581
```


```
npm i https://pkg.pr.new/Tencent/tdesign-vue-next/@tdesign-vue-next/chat@5581
```


_commit: <a href="https://github.com/Tencent/tdesign-vue-next/runs/43746255460"><code>f8f0cf3</code></a>_


Patch:
diff --git a/packages/common b/packages/common
index 077aa2b79..a44293669 160000
--- a/packages/common
+++ b/packages/common
@@ -1,1 +1,1 @@
-Subproject commit 077aa2b794faf0dea1a6fca0cd5616706abcff1d
+Subproject commit a44293669cf1d7181f6fb2f2615d6b808ae6117d
diff --git a/packages/components/cascader/hooks/index.ts b/packages/components/cascader/hooks/index.ts
index 63cb4a233..af157a86e 100644
--- a/packages/components/cascader/hooks/index.ts
+++ b/packages/components/cascader/hooks/index.ts
@@ -197,12 +197,12 @@ export const useCascaderContext = (props: TdCascaderProps) => {
 
       if (isValueInvalid(innerValue.value, cascaderContext.value)) {
         setValue(multiple ? [] : '', 'invalid-value');
-      } else {
-        statusContext.scopeVal = multiple ? [] : '';
       }
 
-      if (!isEmptyValues(innerValue)) {
+      if (!isEmptyValues(innerValue.value)) {
         statusContext.scopeVal = getCascaderValue(innerValue.value, valueType, multiple);
+      } else {
+        statusContext.scopeVal = multiple ? [] : '';
       }
 
       if (!statusContext.treeStore) return;
diff --git a/packages/components/color-picker/components/panel/linear-gradient.tsx b/packages/components/color-picker/components/panel/linear-gradient.tsx
index 5e394982b..371a56556 100644
--- a/packages/components/color-picker/components/panel/linear-gradient.tsx
+++ b/packages/components/color-picker/components/panel/linear-gradient.tsx
@@ -177,8 +177,7 @@ export default defineComponent({
       if (props.disabled || !props.enableMultipleGradient) {
         return;
       }
-      let left = e.clientX - sliderRect.left;
-      left = Math.max(0, Math.min(sliderRect.width, left));
+      const left = e.offsetX;
       const percentLeft = (left / sliderRect.width) * 100;
       const newPoint = genGradientPoint(percentLeft, props.color.rgba);
       colors.value.push(newPoint);
diff --git a/packages/components/select/select.tsx b/packages/components/select/select.tsx
index 7653776f1..3105417ce 100644
--- a/packages/components/select/select.tsx
+++ b/packages/components/select/select.tsx
@@ -471,7 +471,7 @@ export default defineComponent({
 
     const renderValueDisplay = () => {
       const renderTag = () => {
-        if (!props.multiple) {
+        if (!props.multiple || !props.selectInputProps?.multiple) {
           return undefined;
         }
         const currentSelectedOptions = getCurrentSelectedOptions(innerValue.value);
diff --git a/packages/pro-components/chat/_example/chat-sender-slot.vue b/packages/pro-components/chat/_example/chat-sender-slot.vue
index 56d2386df..6f5a7498e 100644
--- a/packages/pro-components/chat/_example/chat-sender-slot.vue
+++ b/packages/pro-components/chat/_example/chat-sender-slot.vue
@@ -3,10 +3,10 @@
     ref="chatSenderRef"
     v-model="inputValue"
     class="chat-sender"
-    :stop-disabled="loading"
     :textarea-props="{
       placeholder: '请输入消息...',
     }"
+    :loading="loading"
     @send="inputEnter"
   >
     <template #suffix>
diff --git a/packages/pro-components/chat/_example/chat-sender.vue b/packages/pro-components/chat/_example/chat-sender.vue
index 79ae8e734..e786991a8 100644
--- a/packages/pro-components/chat/_example/chat-sender.vue
+++ b/packages/pro-components/chat/_example/chat-sender.vue
@@ -1,12 +1,13 @@
 <template>
   <t-chat-sender
     v-model="query"
-    :stop-disabled="loading"
     :textarea-props="{
       placeholder: '请输入消息...',
     }"
+    :loading="loading"
     @send="inputEnter"
     @file-select="fileSelect"
+    @stop="onStop"
   >
     <!-- 自定义操作区域的内容，默认支持图片上传、附件上传和发送按钮 -->
     <template #suffix="{ renderPresets }">
@@ -41,4 +42,7 @@ const inputEnter = function () {
 const fileSelect = (file: File) => {
   console.log(file);
 };
+const onStop = function () {
+  loading.value = false;
+};
 </script>
diff --git a/packages/pro-components/chat/_example/reasoning-drag.vue b/packages/pro-components/chat/_example/reasoning-drag.vue
index cdc478a0f..9ae39dc5c 100644
--- a/packages/pro-components/chat/_example/reasoning-drag.vue
+++ b/packages/pro-components/chat/_example/reasoning-drag.vue
@@ -40,7 +40,7 @@
         <template #footer>
           <t-chat-sender
             v-model="inputValue"
-            :stop-disabled="isStreamLoad"
+            :loading="isStreamLoad"
             :textarea-props="{
               placeholder: '请输入消息...',
             }"
diff --git a/packages/pro-components/chat/_example/reasoning-drawer.vue b/packages/pro-components/chat/_example/reasoning-drawer.vue
index 3e208073c..6a80fd92f 100644
--- a/packages/pro-components/chat/_example/reasoning-drawer.vue
+++ b/packages/pro-components/chat/_example/reasoning-drawer.vue
@@ -33,7 +33,7 @@
       <template #footer>
         <t-chat-sender
           v-model="inputValue"
-          :stop-disabled="isStreamLoad"
+          :loading="isStreamLoad"
           :textarea-props="{
             placeholder: '请输入消息...',
           }"
diff --git a/packages/pro-components/chat/_example/reasoning.vue b/packages/pro-components/chat/_example/reasoning.vue
index d40f68521..f12393b34 100644
--- a/packages/pro-components/chat/_example/reasoning.vue
+++ b/packages/pro-components/chat/_example/reasoning.vue
@@ -31,7 +31,7 @@
       <template #footer>
         <t-chat-sender
           v-model="inputValue"
-          :stop-disabled="isStreamLoad"
+          :loading="isStreamLoad"
           :textarea-props="{
             placeholder: '请输入消息...',
           }"
diff --git a/packages/pro-components/chat/chat-sender-props.ts b/packages/pro-components/chat/chat-sender-props.ts
index a2f6d5b17..79f0253da 100644
--- a/packages/pro-components/chat/chat-sender-props.ts
+++ b/packages/pro-components/chat/chat-sender-props.ts
@@ -19,8 +19,16 @@ export default {
   prefix: {
     type: [String, Function] as PropType<TdChatSenderProps['prefix']>,
   },
-  /** 中止按钮是否可点击。等流式数据全部返回结束置为false，注意跟textLoading的控制时机不是同一个 */
-  stopDisabled: Boolean,
+  /** 发送按钮是否处于加载状态 */
+  stopDisabled: {
+    type: Boolean as PropType<TdChatSenderProps['stopDisabled']>,
+    default: false,
+  },
+  /** 发送按钮是否处于加载状态 */
+  loading: {
+    type: Boolean as PropType<TdChatSenderProps['loading']>,
+    default: false,
+  },
   /** 输入框右下角区域扩展 */
   suffix: {
     type: [String, Function] as PropType<TdChatSenderProps['suffix']>,
diff --git a/packages/pro-components/chat/chat-sender.md b/packages/pro-components/chat/chat-sender.md
index 4f4516449..6d228b11f 100644
--- a/packages/pro-components/chat/chat-sender.md
+++ b/packages/pro-components/chat/chat-sender.md
@@ -9,7 +9,8 @@
 disabled | Boolean | false | 是否禁用输入框 | N
 placeholder | String | - | 输入框默认文案 | N
 prefix | String / Slot / Function | - | 输入框左下角区域扩展。TS 类型：`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts) | N
-stopDisabled | Boolean | false | 中止按钮是否可点击。等流式数据全部返回结束置为false，注意跟textLoading的控制时机不是同一个 | N
+stopDisabled | Boolean | false | 发送按钮是否处于加载状态`待废弃，请尽快使用loading替换` | N
+loading | Boolean | false | 发送按钮是否处于加载状态 | N
 suffix | String / Slot / Function | - | 输入框右下角区域扩展。TS 类型：`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts)。当使用函数形式控制上传按钮时，参数为 `{ renderPresets: UploadActionConfig[] }`，其中 `UploadActionConfig` [详细类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/pro-components/chat/type.ts) | N
 header | String / Slot / Function | - | 输入框外标题区域扩展 | N
 inner-header | String / Slot / Function | - | 输入框内标题区域扩展 | N
diff --git a/packages/pro-components/chat/chat-sender.tsx b/packages/pro-components/chat/chat-sender.tsx
index 96f83d697..eee00fae8 100644
--- a/packages/pro-components/chat/chat-sender.tsx
+++ b/packages/pro-components/chat/chat-sender.tsx
@@ -3,7 +3,7 @@ import { SendFilledIcon, FileAttachmentIcon, ImageIcon } from 'tdesign-icons-vue
 import { Button, Textarea, Tooltip } from 'tdesign-vue-next';
 import { useConfig } from 'tdesign-vue-next/es/config-provider/hooks';
 
-import { usePrefixClass, useTNodeJSX, useContent, useVModel } from '@tdesign/hooks';
+import { usePrefixClass, useTNodeJSX, useVModel } from '@tdesign/hooks';
 import props from './chat-sender-props';
 
 import type { TdChatSenderProps, UploadActionType, UploadActionConfig } from './type';
@@ -23,24 +23,20 @@ export default defineComponent({
     const [textValue, setInnerValue] = useVModel(value, modelValue, props.defaultValue, props.onChange);
 
     const focusFlag = ref(false);
-    const loading = ref(false);
-    const showStopBtn = computed(() => props.stopDisabled && loading.value);
+    const showStopBtn = computed(() => props.loading || props.stopDisabled);
     const disabled = computed(() => props.disabled || false);
     const uploadImageRef = ref(null);
     const uploadFileRef = ref(null);
     const renderTNodeJSX = useTNodeJSX();
-    const renderContent = useContent();
     // 点击了发送按钮
     const sendClick = (e: MouseEvent | KeyboardEvent) => {
       if (textValue.value && !disabled.value) {
         emit('send', textValue.value, { e });
-        loading.value = true;
       }
     };
     // 点击了停止按钮
     const handleStop = (e: MouseEvent) => {
       e.stopPropagation(); // 阻止事件冒泡
-      loading.value = false;
       emit('stop', textValue.value, {
         e,
       });
@@ -221,14 +217,14 @@ export default defineComponent({
     };
     return () => (
       <div class={`${COMPONENT_NAME.value}-sender`}>
-        <div class={`${COMPONENT_NAME.value}-sender__header`}>{renderContent('default', 'header')}</div>
+        <div class={`${COMPONENT_NAME.value}-sender__header`}>{renderTNodeJSX('header')}</div>
         <div
           class={[
             `${COMPONENT_NAME.value}-sender__textarea`,
             focusFlag.value ? `${COMPONENT_NAME.value}-sender__textarea--focus` : '',
           ]}
         >
-          <div class={`${COMPONENT_NAME.value}-sender__inner-header`}>{renderContent('default', 'inner-header')}</div>
+          <div class={`${COMPONENT_NAME.value}-sender__inner-header`}>{renderTNodeJSX('inner-header')}</div>
           <Textarea
             ref={senderTextarea}
             value={textValue.value}
@@ -249,7 +245,7 @@ export default defineComponent({
             onCompositionend={compositionendFn}
           />
           <div class={`${COMPONENT_NAME.value}-sender__footer`}>
-            <div class={`${COMPONENT_NAME.value}-sender__mode`}>{renderContent('default', 'prefix')}</div>
+            <div class={`${COMPONENT_NAME.value}-sender__mode`}>{renderTNodeJSX('prefix')}</div>
             <div class={`${COMPONENT_NAME.value}-sender__button`}>
               {/* 发送按钮 */}
               <div class={`${COMPONENT_NAME.value}-sender__button__sendbtn`}>{renderSuffixIcon()}</div>
diff --git a/packages/pro-components/chat/type.ts b/packages/pro-components/chat/type.ts
index c8275e156..b9f2fcf41 100644
--- a/packages/pro-components/chat/type.ts
+++ b/packages/pro-components/chat/type.ts
@@ -273,10 +273,15 @@ export interface TdChatSenderProps {
    */
   prefix?: string | TNode;
   /**
-   * 中止按钮是否可点击。等流式数据全部返回结束置为false，注意跟textLoading的控制时机不是同一个
-   * @default false
+   * 发送按钮是否处于加载状态，待废弃，请尽快使用 loading 替换
+   * @deprecated
    */
   stopDisabled?: boolean;
+  /**
+   * 发送按钮是否处于加载状态
+   * @default false
+   */
+  loading: boolean;
   /**
    * 输入框右下角区域扩展
    */
diff --git a/packages/tdesign-vue-next-chat/CHANGELOG.md b/packages/tdesign-vue-next-chat/CHANGELOG.md
index 5692b22a1..5a12c5e94 100644
--- a/packages/tdesign-vue-next-chat/CHANGELOG.md
+++ b/packages/tdesign-vue-next-chat/CHANGELOG.md
@@ -5,6 +5,17 @@ toc: false
 spline: explain
 ---
 
+## 🌈 0.4.1 `2025-06-12` 
+
+### 🚀 Features
+- `ChatSender`: 新增 `loading` API，用于控制按钮状态,  `stopDisabled` 将在未来版本废弃，请尽快使用 `loading` 替换⚠️ @zydemail ([#5595](https://github.com/Tencent/tdesign-vue-next/pull/5595))
+
+### 🐞 Bug Fixes
+- `ChatSender`: 
+  - 修复 `stopDisabled` 直接修改值不立即生效的问题 @zydemail ([#5595](https://github.com/Tencent/tdesign-vue-next/pull/5595))
+  - 修复 `header`、`innerHeader` 等插槽的传参问题 @zydemail ([#5595](https://github.com/Tencent/tdesign-vue-next/pull/5595))
+
+
 ## 🌈 0.4.0 `2025-06-06` 
 ### 🚨 Breaking Change
 - 优化产物内容，移除冗余的 bundle 或非冗余 bundle 中的冗余产物，若使用此前文档并未声明的 bundle 内容请注意此变更 ⚠️ @zhangpaopao0609 @uyarn ([#5568](https://github.com/Tencent/tdesign-vue-next/pull/5568))
diff --git a/packages/tdesign-vue-next-chat/package.json b/packages/tdesign-vue-next-chat/package.json
index 4040e8916..49e2ecc75 100644
--- a/packages/tdesign-vue-next-chat/package.json
+++ b/packages/tdesign-vue-next-chat/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@tdesign-vue-next/chat",
-  "version": "0.4.0",
+  "version": "0.4.1",
   "title": "@tdesign-vue-next/chat",
   "description": "AI Chat Component for Vue 3",
   "repository": {
@@ -45,4 +45,4 @@
   "peerDependencies": {
     "vue": ">=3.1.0"
   }
-}
+}
\ No newline at end of file
diff --git a/packages/tdesign-vue-next/.changelog/pr-5565.md b/packages/tdesign-vue-next/.changelog/pr-5565.md
new file mode 100644
index 000000000..96b947192
--- /dev/null
+++ b/packages/tdesign-vue-next/.changelog/pr-5565.md
@@ -0,0 +1,6 @@
+---
+pr_number: 5565
+contributor: betavs
+---
+
+- fix(ColorPicker): 修复渐变模式下点击滑块添加色点时定位错误的问题 @betavs ([#5565](https://github.com/Tencent/tdesign-vue-next/pull/5565))
diff --git a/packages/tdesign-vue-next/.changelog/pr-5581.md b/packages/tdesign-vue-next/.changelog/pr-5581.md
new file mode 100644
index 000000000..bd48ecbb9
--- /dev/null
+++ b/packages/tdesign-vue-next/.changelog/pr-5581.md
@@ -0,0 +1,6 @@
+---
+pr_number: 5581
+contributor: liweijie0812
+---
+
+- fix(cascader): 修复 `value-type="full"` ，value 为 undefined时组件内部报错 @liweijie0812 ([#5581](https://github.com/Tencent/tdesign-vue-next/pull/5581))
diff --git a/packages/tdesign-vue-next/.changelog/pr-5594.md b/packages/tdesign-vue-next/.changelog/pr-5594.md
new file mode 100644
index 000000000..c33e1a97a
--- /dev/null
+++ b/packages/tdesign-vue-next/.changelog/pr-5594.md
@@ -0,0 +1,6 @@
+---
+pr_number: 5594
+contributor: RSS1102
+---
+
+- fix(Select): 添加 `selectInputProps` 透传多选属性到 `valueDisplay` @RSS1102 ([#5594](https://github.com/Tencent/tdesign-vue-next/pull/5594))


Test patch:
diff --git a/packages/components/select/__tests__/__snapshots__/index.test.jsx.snap b/packages/components/select/__tests__/__snapshots__/index.test.jsx.snap
index 479c7f210..bccdeac52 100644
--- a/packages/components/select/__tests__/__snapshots__/index.test.jsx.snap
+++ b/packages/components/select/__tests__/__snapshots__/index.test.jsx.snap
@@ -368,8 +368,6 @@ exports[`Select > :props > :multiple 1`] = `
         >
           
           
-          
-          
         </div>
         <input
           class="t-input__inner"