it's hard for developer to write a common component with vue-demi
See original GitHub issue【description】:
I want to try create the same component for Vue2 & Vue3 in the same source code, so I find vue-demi. But… I have seen some projects likes json-editor-vue. For compact Vue2 & Vue3, I found its source code write render
options for 2 & 3. But i think it’s hard for developer to code.
I prefer to code in template
in a sfc file. So i have some idea(We can smooth the difference with Vue2
& Vue3
when we compile components). Can we write a component with setup
& composition-api
in a sfc
. And then when we compile the component, we can use a series of plugins for Vue2
: unplugin-auto-import
, unplugin-vue2-script-setup
, vite-plugin-vue2
, vue-template-compiler@2.6.x
, and plugins for Vue3
: @vitejs/plugin-vue
.
@antfu Maybe u have thought some idea before create this repo. So can u give me some advice or info?
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:14 (2 by maintainers)
Top GitHub Comments
Of course, in this repository, still have question, i don’t know how to config to generate d.ts on every vue version
Use unbuild for shipping the component directly