-
Notifications
You must be signed in to change notification settings - Fork 24
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
Get code from a slot. #50
Comments
Hello @Decipher, This is a great idea. It looks much cleaner indeed. In styleguidist & in vuepress I preferred a markdown approach. I rarely use vue-live as is, but mostly as part of a bigger plugin. This way I almost never have to use the syntax described above. I say almost impossible, because, in-theory, we could write an intermediary webpack loader. Would you be interested in creating such a loader? |
Hi @elevatebart, I will look more into this as soon as I have a free opportunity. I plan to investigate writing my own webpack loaders anyway, so this would be a good way to learn. |
You can get Slot Content in Vue 3 with: <template>
<VueLive :code="slots.default()[0].children[0]" />
</template>
<script setup>
import { VueLive } from 'vue-live';
import 'vue-live/lib/vue-live.esm.css';
import { useSlots } from 'vue';
const slots = useSlots();
</script> |
Agreed, the content of this |
I think we could probably do it using the same method as histoire |
As a user I want the ability to wrap my code with a the vue-live component so it's code readable but still works.
Currently I have to set my code to a prop, which results in this:
When it would be much nicer to write it like this:
The text was updated successfully, but these errors were encountered: