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

feat: support vue class component and metadata #2238

Closed

Conversation

agileago
Copy link

🤔 这个变动的性质是?/ What is the nature of this change?

  • 新特性提交 / New feature
  • bug 修复 / Fix bug
  • 样式优化 / Style optimization
  • 代码风格优化 / Code style optimization
  • 性能优化 / Performance optimization
  • 构建优化 / Build optimization
  • 网站、文档、Demo 改进 / Website, documentation, demo improvements
  • 重构代码或样式 / Refactor code or style
  • 测试相关 / Test related
  • 其他 / Other

🔗 相关 Issue / Related Issue

💡 需求背景和解决方案 / Background or solution

支持vue类组件,支持使用ts编译组件并生成metadata数据

📝 更新日志 / Changelog

vue支持使用ts编译器编译,支持装饰器和元数据

Language Changelog
🇺🇸 English
🇨🇳 Chinese

Copy link

vercel bot commented Dec 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dumi ❌ Failed (Inspect) Dec 13, 2024 8:38am

@agileago
Copy link
Author

@jeffwcx 麻烦抽空看一下行不行,主要支持了vue的类组件,类组件使用了元数据,没问题的话我就把文档补充一下

@jeffwcx
Copy link
Collaborator

jeffwcx commented Dec 13, 2024

@agileago 我和几个主创商量了一下,我们觉得这个写法不是不可以做,但是不太适合集成到官方插件,最好做成社区插件。这主要是因为这种写法目前vue官方已经放弃,属于也是社区第三方库的支持。

所以我们打算看看如何支持你做成社区插件(可以维护到你自己的 https://github.com/agileago/vue3-oop 仓库里),我简单看了一下,主要是支持ts装饰器的编译,看看preset-vue哪里可以开个口子。

欢迎加群讨论,我也在各个群里,ID也是jeffwcx

@agileago
Copy link
Author

ok,一开始我也想以插件的形式做的,但是有很多都得在源码里面改,那这样吧,也别动了,我自己发个包, 其实已经有了 @vue3-oop/preset-vue. 不过生成API那个,可否加个配置过滤到某些属性,比如 v- 开头的指令型属性

@agileago agileago closed this Dec 14, 2024
@jeffwcx
Copy link
Collaborator

jeffwcx commented Dec 14, 2024

关于API生成这块,本身就有个属性自定义解析器 https://github.com/umijs/dumi/tree/master/suites/dumi-vue-meta#propertyschemaresolver, 识别 v- 肯定可以。但是指令这个会放到props里面吗?

image

@agileago
Copy link
Author

了解了,😄,因为我会把 modelValue这种直接推断出来 v-model 放在属性里面给jsx用

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.

2 participants