aboutsummaryrefslogtreecommitdiff
path: root/src/ui/demo/demo-wrapper.vue
blob: 838fffd0ef3fee951612122e66a48a63dfa96408 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<script lang="ts" setup>
import _ from 'lodash';
import { demoRoutes } from './demo.routes';

const route = useRoute();

const componentName = computed(() => _.startCase(String(route.name).replace(/^c-/, '')));
</script>

<template>
  <div mt-2 w-full p-8>
    <h1>c-lib components</h1>

    <div flex>
      <div w-200px b-r b-gray b-op-10 b-r-solid pr-4>
        <c-button
          v-for="{ name } of demoRoutes"
          :key="name"
          variant="text"
          :to="{ name }"
          w-full
          important:justify-start
          important:text-left
          :type="route.name === name ? 'primary' : 'default'"
        >
          {{ name }}
        </c-button>
      </div>

      <div flex-1 pl-4>
        <h1>{{ componentName }}</h1>

        <router-view />
      </div>
    </div>
  </div>
</template>