Skip to content

Conversation

@liweijie0812
Copy link
Collaborator

@liweijie0812 liweijie0812 commented Nov 3, 2025

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

💡 需求背景和解决方案

复现代码

<template>
  <t-space direction="vertical" align="center">
    <t-radio-group v-model="locale" variant="default-filled">
      <t-radio-button value="zh_CN">中文</t-radio-button>
      <t-radio-button value="en_US">English</t-radio-button>
    </t-radio-group>
    <t-config-provider :global-config="globalConfig">
      <t-empty />
    </t-config-provider>
  </t-space>
</template>
<script setup>
import enConfig from 'tdesign-vue-next/es/locale/en_US';
import zhConfig from 'tdesign-vue-next/es/locale/zh_CN';
import { computed, ref } from 'vue';
const locale = ref('zh_CN');
const globalConfig = computed(() => {
  return locale.value === 'en_US' ? enConfig : zhConfig;
});
</script>

📝 更新日志

  • 本条 PR 不需要纳入 Changelog

tdesign-vue-next

  • fix(empty): 修复多语言动态切换响应式无效

@tdesign-vue-next/chat

@tdesign-vue-next/auto-import-resolver

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@tdesign-bot
Copy link
Collaborator

TDesign Component Site Preview Open

Component Preview
tdesign-vue-next 完成
@tdesign-vue-next/chat 完成

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 3, 2025

tdesign-vue-next-demo

npm i https://pkg.pr.new/Tencent/tdesign-vue-next/@tdesign-vue-next/auto-import-resolver@6126
npm i https://pkg.pr.new/Tencent/tdesign-vue-next@6126
npm i https://pkg.pr.new/Tencent/tdesign-vue-next/@tdesign-vue-next/chat@6126

commit: 9fe932b

@liweijie0812 liweijie0812 requested a review from Copilot November 3, 2025 16:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR converts the defaultMaps object from a static object to a computed property to ensure reactivity when globalConfig changes. This allows the component to properly react to dynamic configuration updates.

  • Wrapped defaultMaps in a computed() function to make it reactive to globalConfig.value changes
  • Added explicit ComputedRef type annotation for better type safety
  • Updated the reference to defaultMaps to access its .value property

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants