vuejs / repl

Vue SFC REPL as a Vue 3 component
https://repl-vuejs.vercel.app
MIT License
908 stars 163 forks source link

It would be nice if we could support importing full components into vue #77

Closed xxholly32 closed 1 year ago

xxholly32 commented 1 year ago

Here's a demo of an element-plus I wrote

and this is element-plus official demo

I've seen a lot of community implementations like https://element-plus.run, which is actually bad for developers, and the pain point is that we can't bring in a whole component library at once. As you can see, the lack of el-rows in my demo caused my code to only partially render

So I have a proposal

// if it works will be great 
import { use } from 'vue'
import ElementPlus from 'element-plus'
use(ElementPlus)
Sight-wcg commented 1 year ago

try it

xxholly32 commented 1 year ago

thanks bro, it works

fanckush commented 1 year ago

@Sight-wcg in the playground link you sent, how does the playground know to import the element-plus npm package? does that happen automatically

edit just saw the "import map" tab 👍