-
Notifications
You must be signed in to change notification settings - Fork 304
chore(site): Convert Vue 2.7 site components from Options API to Composition API with script setup #722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
Co-authored-by: liweijie0812 <[email protected]>
|
@copilot 继续改 |
Co-authored-by: liweijie0812 <[email protected]>
Co-authored-by: liweijie0812 <[email protected]>
|
|
Co-authored-by: liweijie0812 <[email protected]>
Co-authored-by: liweijie0812 <[email protected]>
commit: |
commit: |
|
@copilot 继续修改 |
Co-authored-by: tencent-adm <[email protected]>
Co-authored-by: tencent-adm <[email protected]>
Co-authored-by: tencent-adm <[email protected]>
Co-authored-by: liweijie0812 <[email protected]>
Co-authored-by: liweijie0812 <[email protected]>
TDesign Component Site Preview CI Open |
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 <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,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.
Co-authored-by: Copilot <[email protected]>
|
|
|
@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
|
@copilot merge main 分支代码,处理冲突 |
…t updates Co-authored-by: liweijie0812 <[email protected]>
|
@copilot merge main 分支代码,处理冲突 site/src/pages/design/icon.vue |
Co-authored-by: liweijie0812 <[email protected]>
Co-authored-by: liweijie0812 <[email protected]>
... ✅ 已成功合并 main 分支代码并解决所有冲突。 解决的冲突文件:
所有 Composition API 转换已保留。(dde9eee) |

<script setup>syntax across all site componentsmounted→onMounted(),beforeDestroy→onBeforeUnmount()props→defineProps(),$emit→defineEmits()this.$refs→ ref variablesthis.$route/this.$router→useRoute()/useRouter()this.$message→getCurrentInstance()pattern✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.