组件库如何适配 Vue 2.7 #278
xiaosansiji
started this conversation in
General
Replies: 1 comment
-
请问还在推进吗? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
现状
对于 Vue 社区推出的,旨在引导 Vue 2 用户平滑升级到 Vue 3 的 Vue 2.7 版本,TDesign 目前暂无组件库能够正常运行。
期望
能够用现有 tdesign-vue 或 tdesign-vue-next 组件适配到 Vue 2.7.x 环境。
目前已知问题
tdesign-vue 适配 Vue 2.7
tdesign-vue 中额外引入了
@vue/composition-api
https://github.com/Tencent/tdesign-vue/blob/develop/package.json#L91已经有部分组件用
@vue/composition-api
提供的语法重写了实现,与对应的 tdesign-vue-next 仓库组件共享逻辑实现,降低同时维护的成本。@vue/composition-api
https://github.com/Tencent/tdesign-vue/blob/develop/src/index.ts#L5@vue/composition-api
引入 https://github.com/Tencent/tdesign-vue/blob/develop/src/menu/menu.tsx#L1参照 Vue 2.7.0 changelog
Vue 2.7.x 中已经默认包含了 Composition API,不需要额外引入
@vue/composition-api
,上述两处实现需要做调整:Vue.use(VueCompositionAPI)
处理import { x } from '@vue/composition-api'
改到import { x } from 'vue'
2 不确定是否在用户引入组件库时通过增加其他额外插件或者配置的方式来修改更好。
tdesign-vue-next 适配 Vue 2.7
2.7 版本下缺少如下
import { xx } from 'vue'
的内容:more
如果有其他验证存在的适配问题,或者可行的方案,可以补充在评论中,有切实可行提案后可以启动相关组件库适配改造。
Beta Was this translation helpful? Give feedback.
All reactions