Skip to content
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

支持vue3类组件 #11392

Closed
agileago opened this issue Mar 4, 2022 · 4 comments · Fixed by #11436
Closed

支持vue3类组件 #11392

agileago opened this issue Mar 4, 2022 · 4 comments · Fixed by #11436
Labels
enhancement New feature or request
Milestone

Comments

@agileago
Copy link
Collaborator

agileago commented Mar 4, 2022

这个特性解决了什么问题?

vue3是支持类组件的, 但现在taro-runtime不支持类组件

https://github.com/vuejs/core/blob/5898629d723e82b68e9b17b91bf8b1a8390a3912/packages/runtime-core/src/vnode.ts#L517

这个 API 长什么样?

支持类组件

@taro-bot2 taro-bot2 bot added the enhancement New feature or request label Mar 4, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2022

等待热心的小伙伴解决问题中..., 有一些相关的 issues 可能帮助到你!

Thank you so much!

@agileago
Copy link
Collaborator Author

@Chen-jj

const PageComponent = Object.assign({}, component)

这里为啥要copy一遍, 如果是类组件,他的选项对象在 __vccOpts 上面的,这样会导致类组件渲染不出来

@agileago
Copy link
Collaborator Author

我提个pr?

@Chen-jj
Copy link
Contributor

Chen-jj commented Mar 10, 2022

@agileago 印象中使用 Object.assign 进行阻隔,是因为 Vue 运行时会给 PageComponent 加属性什么的,不新建一个对象会影响新页面挂载。

可以使用 isClassComponent 进行判断,如果是 class 组件则直接赋值给 PageComponent。

欢迎 PR~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants