
        <script setup>
        import { computed } from "vue"
        import { Example, PropsTable, PageTitle } from "@viteplay/vue"
        import { useRoute, useRouter } from "vue-router"
            
        let componentProps = {"CHeader":[{"name":"p_AccountName","type":"string","required":false,"desc":"Headerのアカウント名表示欄\n@example p_AccountName: 'text'"},{"name":"p_MenuList","type":"array","required":false,"desc":"!必須 required\nサブメニュー展開時の表示ボタン\n@example p_MenuList: [\n{\nicon: 'directions_walk', // materilal iconのフォント名\ntext: 'ログアウト',       // アクションに表示するテキスト\nhandler: () => {         // メソッド\nalert('logout')\n},\nvisible: true,           // 表示判定\n},\n   *]"},{"name":"p_Pankuzu","type":"array","required":false,"desc":"パンくずリストの表示テキスト\n@example p_Pankuzu: 'ログアウト'"}]}
        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"].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%20CHeader%20from%20'../CHeader.vue'%0Aconst%20actionButtons%20=%20%5B%0A%20%20%7B%0A%20%20%20%20icon:%20'directions_walk',%0A%20%20%20%20text:%20'%E3%83%AD%E3%82%B0%E3%82%A2%E3%82%A6%E3%83%88',%0A%20%20%20%20handler:%20()%20=%3E%20%7B%0A%20%20%20%20%20%20alert('logout')%0A%20%20%20%20%7D,%0A%20%20%20%20visible:%20true,%0A%20%20%7D,%0A%5D%0A%3C/script%3E%0A%0A%3Ctemplate%3E%0A%20%20%3CCHeader%20p_AccountName=%22text%22%20:p_Pankuzu=%22%5B'%E3%83%88%E3%83%83%E3%83%97',%20'%E5%A3%B2%E4%B8%8A'%5D%22%20:p_MenuList=%22actionButtons%22%20/%3E%0A%3C/template%3E"),
                iframeUrl: "/__iframe/CHeader-basic.html",
                openInEditor: import.meta.env.DEV 
                  ? () => openInEditor("/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CHeader/examples/Basic.vue") 
                  : undefined 
              }
        ]
        </script>
        <template>
          <PageTitle title="CHeader" :openInEditor="() => openInEditor('/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CHeader/CHeader.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="CHeader" :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>
      