Files
estel_docs/content/docs/1.简单文档/5.components/code-group.md
estel be69a51bb2
Some checks failed
CI / lint (push) Has been cancelled
CI / typecheck (push) Has been cancelled
CI / build (ubuntu-latest) (push) Has been cancelled
改回项目内获取md文档
2025-08-08 12:15:35 +08:00

1.4 KiB

title, icon, badges
title icon badges
Code Group lucide:code-xml
value to target
Nuxt UI Pro https://ui.nuxt.com/pro/prose/code-group _blank
value to target
Docus https://docus.dev/api/components#codegroup _blank
value icon to target
Source lucide:code https://github.com/ZTL-UwU/shadcn-docs-nuxt/blob/main/components/content/CodeGroup.vue _blank

Usage

::stack ::div{class="p-4"} ::code-group vue [app.vue] <template> <div> <NuxtLayout> <NuxtPage /> </NuxtLayout> </div> </template>

  ```vue [pages/index.vue]
  <template>
    <div>
      <h1>Welcome to the homepage</h1>
      <AppAlert>
        This is an auto-imported component
      </AppAlert>
    </div>
  </template>
  ```
::

::

::code-group
  ```vue [app.vue]
  <template>
    <div>
      <NuxtLayout>
        <NuxtPage />
      </NuxtLayout>
    </div>
  </template>
  ```

  ```vue [pages/index.vue]
  <template>
    <div>
      <h1>Welcome to the homepage</h1>
      <AppAlert>
        This is an auto-imported component
      </AppAlert>
    </div>
  </template>
  ```
::

::

::alert{to="/components/docs/tabs"} ::code-group{lang="mdc"} is a wrapper around ::tabs{variant="card"}{lang="mdc"}. ::

Props

:field{name="sync" type="string"}[Sync scope for ::tabs]