This repository was archived by the owner on Sep 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +49
-26
lines changed Expand file tree Collapse file tree 4 files changed +49
-26
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
+ <sidebar :stories =" stories" />
2
3
<router-view />
3
- </template >
4
+ </template >
5
+
6
+ <script lang="js">
7
+ import { defineComponent } from ' vue'
8
+ import Sidebar from ' ./components/Sidebar.vue'
9
+ import routes from ' ./.generated/routes.json'
10
+
11
+ export default defineComponent ({
12
+ components: { Sidebar },
13
+ setup () {
14
+ return {
15
+ stories: routes,
16
+ }
17
+ },
18
+ })
19
+ </script >
Original file line number Diff line number Diff line change 1
1
<template >
2
- <Examples :examples = " examples " />
2
+ <SideBar :stories = " stories " />
3
3
</template >
4
4
5
5
<script >
6
6
import { defineComponent , h } from ' vue'
7
- import CButton from ' @chakra-ui/c-button '
7
+ import SideBar from ' ./Sidebar.vue '
8
8
import { RouterLink } from ' vue-router'
9
9
import routes from ' ../.generated/routes.json'
10
10
11
- const Examples = defineComponent ({
12
- props: [' examples' ],
13
- setup (props ) {
14
- return () => {
15
- return h (
16
- ' ul' ,
17
- props .examples .map (example =>
18
- h (
19
- ' li' ,
20
- { key: example .path },
21
- example .children
22
- ? h (' h3' , example .name )
23
- : [h (RouterLink, { to: example .path }, () => example .name )],
24
- example .children && h (Examples, { examples: example .children })
25
- )
26
- )
27
- )
28
- }
29
- },
30
- })
31
11
32
12
export default defineComponent ({
33
- components: { Examples, CButton },
13
+ components: { SideBar },
34
14
setup () {
35
15
return {
36
- examples : routes,
16
+ stories : routes,
37
17
}
38
18
},
39
19
})
Original file line number Diff line number Diff line change
1
+ <script >
2
+ import { defineComponent , h } from ' vue'
3
+ import { RouterLink } from ' vue-router'
4
+ import routes from ' ../.generated/routes.json'
5
+
6
+ const Stories = defineComponent ({
7
+ props: [' stories' ],
8
+ setup (props ) {
9
+ return () => {
10
+ return h (
11
+ ' ul' ,
12
+ props .stories .map (story =>
13
+ h (
14
+ ' li' ,
15
+ { key: story .path },
16
+ story .children
17
+ ? h (' h3' , story .name )
18
+ : [h (RouterLink, { to: story .path }, () => story .name )],
19
+ story .children && h (Stories, { stories: story .children })
20
+ )
21
+ )
22
+ )
23
+ }
24
+ },
25
+ })
26
+
27
+ export default Stories
28
+ </script >
Original file line number Diff line number Diff line change 1
1
import { createApp } from 'vue'
2
2
import App from './App.vue'
3
- import './index.css'
4
3
import router from './router'
5
4
6
5
createApp ( App )
You can’t perform that action at this time.
0 commit comments