|
| 1 | +<script setup lang="ts"> |
| 2 | +const paths = import.meta.glob("./components/*.vue") as any; |
| 3 | +const components = Object.keys(paths) |
| 4 | + .map((c: string) => c.replace(".vue", "")) |
| 5 | + .map((c: string) => c.replace("./components/", "")) |
| 6 | + .map((c: string) => `/${c}`) |
| 7 | + .map((c: string) => { |
| 8 | + const name = c.split("/")[1]; |
| 9 | + return { |
| 10 | + name, |
| 11 | + link: c, |
| 12 | + }; |
| 13 | + }); |
| 14 | +</script> |
| 15 | + |
1 | 16 | <template> |
2 | | - <div id="main"> |
3 | | - <div id="nav"> |
| 17 | + <div id="app"> |
| 18 | + <nav id="nav"> |
4 | 19 | <router-link to="/" class="py-4 ps-0 text-center"> |
5 | 20 | <img |
6 | 21 | class="image__oruga" |
7 | 22 | src="https://raw.githubusercontent.com/oruga-ui/theme-bootstrap/master/public/logo.svg" |
8 | 23 | alt="Logo Oruga Theme Bootstrap" /> |
9 | 24 | <b class="fs-5 text-white">Oruga Bootstrap Theme</b> |
10 | 25 | </router-link> |
11 | | - <router-link to="/autocomplete">Autocomplete</router-link> |
12 | | - <router-link to="/button">Button</router-link> |
13 | | - <router-link to="/carousel">Carousel</router-link> |
14 | | - <router-link to="/checkbox">Checkbox</router-link> |
15 | | - <router-link to="/collapse">Collapse</router-link> |
16 | | - <router-link to="/datepicker">Datepicker</router-link> |
17 | | - <router-link to="/dropdown">Dropdown</router-link> |
18 | | - <router-link to="/field">Field</router-link> |
19 | | - <router-link to="/icon">Icon</router-link> |
20 | | - <router-link to="/input">Input</router-link> |
21 | | - <router-link to="/loading">Loading</router-link> |
22 | | - <router-link to="/modal">Modal</router-link> |
23 | | - <router-link to="/notification">Notification</router-link> |
24 | | - <router-link to="/pagination">Pagination</router-link> |
25 | | - <router-link to="/radio">Radio</router-link> |
26 | | - <router-link to="/select">Select</router-link> |
27 | | - <router-link to="/sidebar">Sidebar</router-link> |
28 | | - <router-link to="/skeleton">Skeleton</router-link> |
29 | | - <router-link to="/slider">Slider</router-link> |
30 | | - <router-link to="/steps">Steps</router-link> |
31 | | - <router-link to="/switch">Switch</router-link> |
32 | | - <router-link to="/table">Table</router-link> |
33 | | - <router-link to="/tabs">Tabs</router-link> |
34 | | - <router-link to="/taginput">Taginput</router-link> |
35 | | - <router-link to="/timepicker">Timepicker</router-link> |
36 | | - <router-link to="/tooltip">Tooltip</router-link> |
37 | | - <router-link to="/upload">Upload</router-link> |
38 | | - </div> |
| 26 | + <hr /> |
| 27 | + <router-link v-for="item in components" :key="item.name" :to="item.link"> |
| 28 | + {{ item.name }} |
| 29 | + </router-link> |
| 30 | + </nav> |
39 | 31 |
|
40 | | - <section class="section"> |
| 32 | + <main> |
41 | 33 | <router-view /> |
42 | | - </section> |
| 34 | + </main> |
43 | 35 | </div> |
44 | 36 | </template> |
45 | 37 |
|
46 | 38 | <style lang="scss"> |
47 | | -#main { |
| 39 | +#app { |
48 | 40 | display: flex; |
49 | | - .section { |
| 41 | + width: 100%; |
| 42 | + main { |
50 | 43 | flex-grow: 1; |
51 | 44 | margin: 25px; |
52 | 45 | } |
| 46 | +
|
| 47 | + section { |
| 48 | + padding: 1rem 0; |
| 49 | +
|
| 50 | + h3 { |
| 51 | + font-size: 1.75rem; |
| 52 | + } |
| 53 | +
|
| 54 | + .buttons > * { |
| 55 | + margin-right: 0.5rem; |
| 56 | + margin-bottom: 0.5rem; |
| 57 | + } |
| 58 | + } |
| 59 | +
|
53 | 60 | #nav { |
54 | 61 | display: flex; |
55 | 62 | flex-direction: column; |
|
0 commit comments