nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.12k stars 622 forks source link

Can't find GroupCode component #1719

Closed Croodo closed 1 year ago

Croodo commented 1 year ago

Can anyone please share the CodeGroup component? I need the code for editing. In the prose section, only the ProseCode component is available. CodeGroup Code from nuxt content v1 is not working on v2.

Before Nuxt3 and Nuxt Content v2 This mounted function was used to access slots property on the theme doc. mounted() { this.tabs = this.$slots.default .filter((slot) => Boolean(slot.componentOptions)) .map((slot) => { return { label: slot.componentOptions.propsData.label, elm: slot.elm, }; }); },

this.$slots.default was accessible. can anyone tell me how can I access the slots property in Nuxt3?

farnabaz commented 1 year ago

CodeGroup was part of content-docs-theme which is replaced by Docus. You need to migrate to Docus or build your own theme.

Here is docs for Docus CodeGroup

Croodo commented 1 year ago

Thanks for the reference . Actually needed only the CodeGroup part. I guess I have to create it myself.

Mokkapps commented 1 year ago

I created a StackBlitz that demonstrates a CodeGroup content component inspired by the Docus CodeGroup component

Hope that helps anybody who is looking for such a component in Nuxt Content!

leosin commented 11 months ago

I created a StackBlitz that demonstrates a CodeGroup content component inspired by the Docus CodeGroup component

Hope that helps anybody who is looking for such a component in Nuxt Content!

Thanks for the code, but in Nuxt 3.8 and content 2.9.0 not working, the highlight not work, the tabs disappear, If you have time, can you check it out? Is it caused by an upstream upgrade?

Mokkapps commented 11 months ago

I created a StackBlitz that demonstrates a CodeGroup content component inspired by the Docus CodeGroup component Hope that helps anybody who is looking for such a component in Nuxt Content!

Thanks for the code, but in Nuxt 3.8 and content 2.9.0 not working, the highlight not work, the tabs disappear, If you have time, can you check it out? Is it caused by an upstream upgrade?

I plan to upgrade my portfolio website to Nuxt 3.8 during Christmas holidays, I will check this soon

Mokkapps commented 11 months ago

@leosin I fixed it: https://stackblitz.com/edit/nuxt-content-code-group-qrvays?file=components%2Fcontent%2FCodeGroup.vue

leosin commented 11 months ago

@leosin I fixed it: https://stackblitz.com/edit/nuxt-content-code-group-qrvays?file=components%2Fcontent%2FCodeGroup.vue

it works thank you very much :) ☕️