vuejs / repl

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

feat: add default height for Repl component #109

Closed zqran closed 1 year ago

zqran commented 1 year ago

When using the Repl component as a third-party package, it does not have a default height, so it will cause nothing to be seen in the left editor:

image

If this is adopted, we also need to update the default style of sfc-playground in vue/core. ( related to: https://github.com/vuejs/core/pull/8628 )

sxzz commented 1 year ago

But not all apps need put it in whole screen, like Vue docs

zqran commented 1 year ago

Yes, maybe 100vh is not a good default value, but Repl should have a default to ensure usability.

In my opinion, when using Repl, it usually has a larger page ratio, so I set 100vh as the default value for it.

sxzz commented 1 year ago

For general usage, I think we can pass the style directly, instead of a default height.

<Repl style="height: 100vh" />

zqran commented 1 year ago

This is fine, but it's like having an Input component, which is invisible by default and must be set to a height before it can be used. Will this be a little troublesome?

However, there is corresponding sample code in the documentation, so it should be fine.

sxzz commented 1 year ago

Maybe we can add width: 100% to fit the parent container.

zqran commented 1 year ago

Maybe we can add width: 100% to fit the parent container.

Did you mean height: 100% ?