Skip to content

Commit 260b822

Browse files
committed
feat: replace Playground component with LiveCodes in examples and add LiveCodes component
1 parent 409168c commit 260b822

File tree

5 files changed

+19
-96
lines changed

5 files changed

+19
-96
lines changed

docs/.vitepress/components/Example.vue

Lines changed: 0 additions & 83 deletions
This file was deleted.

docs/.vitepress/components/Playground.vue renamed to docs/.vitepress/components/LiveCodes.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ const config: EmbedOptions['config'] = {
3939
'vue3-carousel': 'https://cdn.jsdelivr.net/npm/vue3-carousel/dist/carousel.mjs',
4040
'vue3-carousel/carousel.css':
4141
'https://cdn.jsdelivr.net/npm/vue3-carousel/dist/carousel.css',
42-
'vue3-carousel/dist/carousel.css':
43-
'https://cdn.jsdelivr.net/npm/vue3-carousel/dist/carousel.css',
4442
},
4543
}
4644
@@ -66,3 +64,10 @@ watch(isDark, () => {
6664
:style="{ height: props.height || '250px' }"
6765
/>
6866
</template>
67+
68+
69+
<style>
70+
.carousel {
71+
display: none !important;
72+
}
73+
</style>

docs/examples.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,51 @@ If you're experiencing issues loading the live examples or you're browsing on a
66

77
A simple implementation of the carousel with default settings.
88

9-
<Playground v-bind="examples.basic" />
9+
<live-codes v-bind="LiveCodeExamples.basic" />
1010

1111
## Wrap Around
1212

1313
Demonstrates a carousel with continuous wrap-around functionality.
1414

15-
<Playground v-bind="examples.wrapAround" />
15+
<live-codes v-bind="LiveCodeExamples.wrapAround" />
1616

1717
## Vertical
1818

1919
Showcases a vertically scrolling carousel. Adjust the height to better fit your content.
2020

21-
<Playground v-bind="examples.vertical" height="475px" />
21+
<live-codes v-bind="LiveCodeExamples.vertical" height="475px" />
2222

2323
## Breakpoints
2424

2525
An example of a responsive carousel with breakpoints for varying screen sizes.
2626

27-
<Playground v-bind="examples.breakpoints" />
27+
<live-codes v-bind="LiveCodeExamples.breakpoints" />
2828

2929
## Autoplay
3030

3131
Illustrates the carousel with autoplay functionality enabled.
3232

33-
<Playground v-bind="examples.autoplay" />
33+
<live-codes v-bind="LiveCodeExamples.autoplay" />
3434

3535
## Active Classes
3636

3737
An example highlighting active items with custom classes.
3838

39-
<Playground v-bind="examples.activeClasses" />
39+
<live-codes v-bind="LiveCodeExamples.activeClasses" />
4040

4141
## Custom Navigation
4242

4343
A demonstration of the carousel with fully customizable navigation controls.
4444

45-
<Playground v-bind="examples.customNavigation" height="260px" />
45+
<live-codes v-bind="LiveCodeExamples.customNavigation" height="260px" />
4646

4747
## Gallery
4848

4949
Transforms the carousel into a gallery-style component.
5050

51-
<Playground v-bind="examples.gallery" height="455px" />
51+
<live-codes v-bind="LiveCodeExamples.gallery" height="455px" />
5252

5353
<script setup>
54-
import Playground from './.vitepress/components/Playground.vue';
55-
import { examples } from './examples/examples';
54+
import LiveCodes from './.vitepress/components/LiveCodes.vue';
55+
import { LiveCodeExamples } from './examples';
5656
</script>

docs/examples/examples.ts renamed to docs/examples/LiveCodeExamples.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const examples: Record<string, { code: string; styles: string }> = {
1+
export const LiveCodeExamples: Record<string, { code: string; styles: string }> = {
22
basic: {
33
code: `
44
<script setup>

docs/examples/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './LiveCodeExamples'

0 commit comments

Comments
 (0)