question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:open
  • Created a year ago
  • Reactions:2
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Hisionicommented, Nov 26, 2022

@Hisioni can you share your vue-demi repo? If it possible

Of course, in this repository, still have question, i don’t know how to config to generate d.ts on every vue version

2reactions
wobsorianocommented, Apr 15, 2022

Use unbuild for shipping the component directly

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · vueuse/vue-demi - GitHub
Contribute to vueuse/vue-demi development by creating an account on ... it's hard for developer to write a common component with vue-demi.
Read more >
Build a universal Vue component library with Vue Demi
According to creator Anthony Fu, Vue Demi is a developing utility that allows users to write universal Vue libraries for Vue 2 and...
Read more >
Ask Question - Stack Overflow
According to this ticket, this issue has now been resolved: The effectScope API was just recently introduced (vuejs/core#2195).
Read more >
Composable Vue - VueDay 2021 - Anthony Fu
My sharing today is Composable Vue, some pattens and tips that might be able to help you writing better composable logic in Vue....
Read more >
Vue Suspense Implementation in Action | by Ish∆n - ITNEXT
We will make a new component the name would be Home.vue. Inside the file we will have some async operation in setup method...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found