-
Notifications
You must be signed in to change notification settings - Fork 312
Comments
chore(site): Convert Vue 2.7 site components from Options API to Composition API with script setup#722
Conversation
- Convert Vue 2.7 site components from Options API to Composition API
- Apply
syntax across all site components - Convert lifecycle hooks:
mounted-onMounted(),beforeDestroy-onBeforeUnmount() - Convert component API:
props-defineProps(),$emit-defineEmits() - Convert template refs:
this.$refs- ref variables - Convert router integration:
this.$route/this.$router-useRoute()/useRouter() - Convert Vue 2 filters to standalone functions
- Handle global properties:
this.$message-getCurrentInstance()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.
|
|
|
@copilot Ji Xu Gai |
|
|
npm i https://pkg.pr.new/Tencent/tdesign/@tdesign/site-components@722npm i https://pkg.pr.new/Tencent/tdesign/@tdesign/theme-generator@722commit: |
npm i https://pkg.pr.new/Tencent/tdesign/@tdesign/site-components@722npm i https://pkg.pr.new/Tencent/tdesign/tdesign-theme-generator@722commit: |
|
@copilot Ji Xu Xiu Gai |
Ji Xu Zhuan Huan Liao 5Ge Zu Jian ,Bao Gua Quan Bu De componentsWen Jian Jia Nei De Zu Jian He 2Ge She Ji Ye Mian Wen Jian . Xian Zai Yi Wan Cheng 18/31Ge Zu Jian De Zhuan Huan (58%). Yi Jian Li Liao anchorMixinZhuan Huan Mo Shi ,Bing Zai Ju You Mu Lu Gong Neng De She Ji Ye Mian Zhong Yi Zhi Ying Yong . Ji Xu Zhuan Huan Sheng Yu De She Ji Ye Mian He Suo Yin Ye Mian . (ab3b15b) |
Ji Xu Zhuan Huan Liao 4Ge Zhong Yao De She Ji Ye Mian Zu Jian ,Bao Gua motionDong Hua Ye Mian (Zhi Chi LottieDong Hua ), colorSe Cai Xi Tong Ye Mian (Da Xing Shu Ju Jie Gou )He sourceZi Yuan Ye Mian (Fu Za Lu You Jiao Hu ). Xian Zai Yi Wan Cheng 29/31Ge Zu Jian De Zhuan Huan (94%),Jin Sheng Yu 2Ge Chao Da Wen Jian (1000+Xing )De Shou Ye Zu Jian Xu Yao Chu Li . (11417a2) |
There was a problem hiding this 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 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,computed-computed(), and lifecycle hooks to their Composition API equivalents - Template refs: Migrating from
this.$refsto 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.
|
|
|
@copilot merge main Fen Zhi Dai Ma ,Chu Li Chong Tu |
- 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
Yi Cheng Gong He Bing Zhu Fen Zhi Dai Ma Bing Jie Jue Suo You Chong Tu . He Bing Nei Rong :
Suo You Chong Tu Yi Jie Jue ,Composition API Xian Dai Hua Gai Zao Wan Zheng Bao Liu . (bb25884) |
|
@copilot merge main Fen Zhi Dai Ma ,Chu Li Chong Tu |
Co-authored-by: liweijie0812 <10710889+liweijie0812@users.noreply.github.com>
Yi Cheng Gong He Bing Zhu Fen Zhi Dai Ma Bing Jie Jue Suo You Chong Tu . He Bing Nei Rong :
Suo You Chong Tu Yi Jie Jue ,Composition API Xian Dai Hua Gai Zao Wan Zheng Bao Liu . (f97e1ff) |
|
@copilot merge main Fen Zhi Dai Ma ,Chu Li Chong Tu site/src/pages/design/icon.vue |
... Yi Cheng Gong He Bing main Fen Zhi Dai Ma Bing Jie Jue Suo You Chong Tu . Jie Jue De Chong Tu Wen Jian :
Suo You Composition API Zhuan Huan Yi Bao Liu . (dde9eee) |