
        <script setup>
        import { computed } from "vue"
        import { Example, PropsTable, PageTitle } from "@viteplay/vue"
        import { useRoute, useRouter } from "vue-router"
            
        let componentProps = {"CTab":[{"name":"p_TabTitle","type":"array","required":false,"desc":"タブ内のテキスト\n* @example p_TabTitle: [\n      { content: 'text', badgeNum:10 },\n      { content: 'text' },\n    ]"},{"name":"modelValue","type":"number","required":false,"desc":"選択tabの初期値\n@example modelValue: 0"}]}
        let route = useRoute()
        let router = useRouter()
        let focusId = computed(() => route.query.focus && route.hash.slice(1))
        let shouldRender = (slug) => {
          return !route.query.focus || slug === focusId.value
        }
        let hiddenCount = computed(() => {
          return ["basic","secondary"].filter((slug) => !shouldRender(slug)).length
        })

        let showAll = () => {
          router.push({ query: {}, hash: route.hash })
        }

        let openInEditor = (file) => {
           fetch('/__open-in-editor?file=' + encodeURIComponent(file))
        }
        let examples = [
          {
                title: "Basic",
                slug: "basic",
                docs: {"content":"","attrs":{}},
                // encodeURI because the example will contain html tags
                // which will cause this component to be incorrectly parsed
                code: decodeURI("%3Cscript%20setup%3E%0Aimport%20CTab%20from%20'../CTab.vue'%0Aimport%20%7B%20ref%20%7D%20from%20'vue'%0Aconst%20tab%20=%20%5B%7B%20content:%20'%E3%82%A2%E3%83%97%E3%83%AA%E3%81%AB%E6%8E%B2%E8%BC%89%E3%81%97%E3%81%AA%E3%81%84',%20badgeNum:%2010%20%7D,%20%7B%20content:%20'%E3%82%A2%E3%83%97%E3%83%AA%E3%81%AB%E6%8E%B2%E8%BC%89%E3%81%97%E3%81%AA%E3%81%84'%20%7D%5D%0A//%E9%81%B8%E6%8A%9Etab%E3%81%AE%E5%88%9D%E6%9C%9F%E5%80%A4%0Aconst%20num%20=%20ref(0)%0A%3C/script%3E%0A%0A%3Ctemplate%3E%0A%20%20%3Cdiv%20class=%22test%22%3E%0A%20%20%20%20%3CCTab%20:p_TabTitle=%22tab%22%20v-model=%22num%22%20/%3E%0A%20%20%3C/div%3E%0A%20%20model:%7B%7B%20num%20%7D%7D%0A%3C/template%3E%0A%3Cstyle%3E%0A:root%20%7B%0A%20%20--q-primary:%20#5e421d;%0A%20%20--q-secondary:%20#f2961c;%0A%7D%0A.test%20%7B%0A%20%20width:%20500px;%0A%7D%0A%3C/style%3E"),
                iframeUrl: "/__iframe/CTab-basic.html",
                openInEditor: import.meta.env.DEV 
                  ? () => openInEditor("/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CTab/examples/Basic.vue") 
                  : undefined 
              },{
                title: "secondary",
                slug: "secondary",
                docs: {"content":"","attrs":{}},
                // encodeURI because the example will contain html tags
                // which will cause this component to be incorrectly parsed
                code: decodeURI("%3Cscript%20setup%3E%0Aimport%20CTab%20from%20'../CTab.vue'%0Aimport%20%7B%20ref%20%7D%20from%20'vue'%0A//%E9%81%B8%E6%8A%9Etab%E3%81%AE%E5%88%9D%E6%9C%9F%E5%80%A4%0Aconst%20num%20=%20ref(0)%0Aconst%20tab%20=%20%5B%0A%20%20%7B%20content:%20'Tab1',%20badgeNum:%201%20%7D,%0A%20%20%7B%20content:%20'Tab2'%20%7D,%0A%20%20%7B%20content:%20'Tab3'%20%7D,%0A%20%20%7B%20content:%20'Tab4'%20%7D,%0A%20%20%7B%20content:%20'Tab5'%20%7D,%0A%20%20%7B%20content:%20'Tab6'%20%7D,%0A%5D%0A%3C/script%3E%0A%0A%3Ctemplate%3E%0A%20%20%3CCTab%20:p_TabTitle=%22tab%22%20v-model=%22num%22%20/%3E%0A%3C/template%3E"),
                iframeUrl: "/__iframe/CTab-secondary.html",
                openInEditor: import.meta.env.DEV 
                  ? () => openInEditor("/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CTab/examples/secondary.vue") 
                  : undefined 
              }
        ]
        </script>
        <template>
          <PageTitle title="CTab" :openInEditor="() => openInEditor('/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CTab/CTab.vue')" />
          <div v-if="hiddenCount > 0" class="hidden-examples-info">
            {{ hiddenCount }} example{{ hiddenCount > 1 ? "s" : null }} hidden, <a class="viteplay-link" type="button" @click.prevent="showAll">show all</a>
          </div>
          <PropsTable componentName="CTab" :componentProps="componentProps" />
          <template  
            v-for="example in examples" 
            :key="example.slug">
            <Example 
              v-if="shouldRender(example.slug)"
              :example="example" 
              :componentProps="componentProps" />
          </template>
        </template>

<style scoped>
.hidden-examples-info {
  margin: 20px 0;
}
</style>
      