
        <script setup>
        import { computed } from "vue"
        import { Example, PropsTable, PageTitle } from "@viteplay/vue"
        import { useRoute, useRouter } from "vue-router"
            
        let componentProps = {"CTrash":[{"name":"disabled","type":"boolean","required":false,"desc":"ボタンの有効無効の切り替え\n@example disabled: false"}]}
        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","disabled"].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%20CTrash%20from%20'../CTrash.vue'%0Aconst%20clickBtn%20=%20()%20=%3E%20alert('test')%0A%3C/script%3E%0A%0A%3Ctemplate%3E%0A%20%20%3CCTrash%20:disabled=%22false%22%20@click=%22clickBtn%22%20/%3E%0A%3C/template%3E"),
                iframeUrl: "/__iframe/CTrash-basic.html",
                openInEditor: import.meta.env.DEV 
                  ? () => openInEditor("/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CTrash/examples/Basic.vue") 
                  : undefined 
              },{
                title: "disabled",
                slug: "disabled",
                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%20CTrash%20from%20'../CTrash.vue'%0A%3C/script%3E%0A%0A%3Ctemplate%3E%0A%20%20%3CCTrash%20:disabled=%22true%22%20/%3E%0A%3C/template%3E"),
                iframeUrl: "/__iframe/CTrash-disabled.html",
                openInEditor: import.meta.env.DEV 
                  ? () => openInEditor("/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CTrash/examples/disabled.vue") 
                  : undefined 
              }
        ]
        </script>
        <template>
          <PageTitle title="CTrash" :openInEditor="() => openInEditor('/Users/nakashimakeiju/ghq/github.com/CodeLic/console/src/components/CTrash/CTrash.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="CTrash" :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>
      