Skip to content

Conversation

Copy link

Copilot AI commented Sep 1, 2025

  • Convert Vue 2.7 site components from Options API to Composition API
  • Apply <script setup> syntax across all site components
  • Convert lifecycle hooks: mountedonMounted(), beforeDestroyonBeforeUnmount()
  • Convert component API: propsdefineProps(), $emitdefineEmits()
  • Convert template refs: this.$refs → ref variables
  • Convert router integration: this.$route/this.$routeruseRoute()/useRouter()
  • Convert Vue 2 filters to standalone functions
  • Handle global properties: this.$messagegetCurrentInstance() pattern
  • Exclude theme generator components from migration (pending refactor)
  • Merge main branch and resolve conflicts
    • Preserved all Composition API conversions in icon.vue, icon_zh-CN.vue, layout.vue, layout_zh-CN.vue
    • Maintained CSS syntax fixes in icon.less
    • Integrated main branch updates

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@tencent-adm
Copy link
Member

tencent-adm commented Sep 1, 2025

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ liweijie0812
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

@liweijie0812
Copy link
Collaborator

@copilot 继续改

@tencent-adm
Copy link
Member

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 1, 2025

Open in StackBlitz

npm i https://pkg.pr.new/Tencent/tdesign/@tdesign/site-components@722
npm i https://pkg.pr.new/Tencent/tdesign/tdesign-theme-generator@722

commit: bb25884

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 1, 2025

Open in StackBlitz

npm i https://pkg.pr.new/Tencent/tdesign/@tdesign/site-components@722
npm i https://pkg.pr.new/Tencent/tdesign/tdesign-theme-generator@722

commit: d08ce00

@liweijie0812
Copy link
Collaborator

@copilot 继续修改

Copy link
Author

Copilot AI commented Sep 1, 2025

@copilot 继续改

继续转换了5个组件,包括全部的components文件夹内的组件和2个设计页面文件。现在已完成18/31个组件的转换(58%)。已建立了anchorMixin转换模式,并在具有目录功能的设计页面中一致应用。继续转换剩余的设计页面和索引页面。(ab3b15b)

Copilot AI changed the title [WIP] site vue2.7 用法改成 script setup Convert Vue 2.7 site components from Options API to Composition API with script setup Sep 1, 2025
Copilot AI requested a review from tencent-adm September 1, 2025 03:49
Copilot finished work on behalf of tencent-adm September 1, 2025 03:49
Copy link
Author

Copilot AI commented Sep 1, 2025

@copilot 继续修改

继续转换了4个重要的设计页面组件,包括motion动画页面(支持Lottie动画)、color色彩系统页面(大型数据结构)和source资源页面(复杂路由交互)。现在已完成29/31个组件的转换(94%),仅剩余2个超大文件(1000+行)的首页组件需要处理。 (11417a2)

Copilot finished work on behalf of liweijie0812 September 1, 2025 04:05
@tdesign-bot
Copy link
Collaborator

tdesign-bot commented Sep 2, 2025

TDesign Component Site Preview CI Open

Sites (8)
Component Preview
tdesign-site 完成
tdesign-vue 完成
tdesign-react 完成
tdesign-vue-next 完成
@tdesign-vue-next/chat 完成
tdesign-mobile-vue 完成
tdesign-mobile-react 完成
tdesign-miniprogram 完成

@liweijie0812 liweijie0812 marked this pull request as ready for review September 3, 2025 13:36
@liweijie0812 liweijie0812 requested a review from Copilot September 3, 2025 13:40
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 Vue 2.7 site components from the Options API to the Composition API using the modern <script setup> syntax. The migration improves code organization, type inference, and development experience while maintaining full backward compatibility across 29 site components.

Key changes include:

  • API Migration: Converting data()ref()/reactive(), methods → functions, computedcomputed(), and lifecycle hooks to their Composition API equivalents
  • Template refs: Migrating from this.$refs to ref variables with proper naming conventions
  • Mixin elimination: Converting shared functionality from mixins to standalone utility functions

Reviewed Changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
site.config.mjs / site-en.config.mjs Updates route names for consistency
mixins/ Removes Options API mixins in favor of Composition API utilities
home/ Converts banner, component-list, and avatar components to Composition API
design/ Migrates all design documentation components with proper anchor handling
about/ Converts about section components maintaining page loading functionality
components/ Updates shared components like download-dialog and design-source
App.vue Root component migration with proper route watching

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@tencent-adm
Copy link
Member

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ liweijie0812
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

@liweijie0812
Copy link
Collaborator

@copilot merge main 分支代码,处理冲突

…nality

- Merged main branch changes including new icons functionality
- Preserved Composition API conversions in all affected files
- Integrated icons tab in source pages (English and Chinese)
- Maintained all existing site component modernizations
- Added support for /icons and /icons-en routes in App.vue header handling
Copy link
Author

Copilot AI commented Sep 9, 2025

@copilot merge main 分支代码,处理冲突

✅ 已成功合并主分支代码并解决所有冲突。

合并内容:

  • 集成了主分支的图标功能更新(包含新的 /icons/icons-en 路由)
  • 在所有受影响文件中保留了 Composition API 转换
  • 更新了资源页面的图标选项卡功能(中英文版本)
  • 添加了 App.vue 中对图标路由的头部处理支持

所有冲突已解决,Composition API 现代化改造完整保留。(bb25884)

Copilot finished work on behalf of liweijie0812 September 9, 2025 14:21
@liweijie0812 liweijie0812 requested a review from uyarn October 13, 2025 05:26
@liweijie0812 liweijie0812 changed the title Convert Vue 2.7 site components from Options API to Composition API with script setup chore(site): Convert Vue 2.7 site components from Options API to Composition API with script setup Nov 26, 2025
@liweijie0812
Copy link
Collaborator

@copilot merge main 分支代码,处理冲突

Copy link
Author

Copilot AI commented Nov 28, 2025

@copilot merge main 分支代码,处理冲突

✅ 已成功合并主分支代码并解决所有冲突。

合并内容:

  • 集成了图标页面的 Link1Icon 组件和 handleClickBtn 方法
  • 更新了 layout.vue 的英文翻译数据
  • 保留了所有 Composition API 转换

所有冲突已解决,Composition API 现代化改造完整保留。(f97e1ff)

@liweijie0812
Copy link
Collaborator

@copilot merge main 分支代码,处理冲突
This branch has conflicts that must be resolved

site/src/pages/design/icon.vue
site/src/pages/design/icon_zh-CN.vue
site/src/pages/design/layout.vue
site/src/pages/design/layout_zh-CN.vue

Copy link
Author

Copilot AI commented Nov 28, 2025

@copilot merge main 分支代码,处理冲突
This branch has conflicts that must be resolved

...

✅ 已成功合并 main 分支代码并解决所有冲突。

解决的冲突文件:

  • site/src/pages/design/icon.vue - 保留 Composition API
  • site/src/pages/design/icon_zh-CN.vue - 保留 Composition API
  • site/src/pages/design/layout.vue - 保留 Composition API
  • site/src/pages/design/layout_zh-CN.vue - 保留 Composition API
  • site/src/style/icon.less - 保留 CSS 语法修复

所有 Composition API 转换已保留。(dde9eee)

Copilot finished work on behalf of liweijie0812 November 28, 2025 03:34
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.

5 participants