변경 로그 버전
변경 로그 버전 (ChangelogVersion)
변경 로그에 표시할 수 있는 커스터마이즈 가능한 기사 컴포넌트예요. 제목, 설명, 이미지, 작성자 등을 자유롭게 구성할 수 있어요.
출처: Nuxt UI
본문
변경 로그에 표시할 수 있는 커스터마이즈 가능한 기사 컴포넌트예요.
사용 방법 (Usage)
ChangelogVersion 컴포넌트는 제목, 설명, 이미지 등을 포함한 내용을 자유롭게 커스터마이즈할 수 있는 <article> 요소를 유연하게 표시해 줘요.
<template>
<u-changelog-version :authors="[
{
name: 'Benjamin Canac',
description: '@benjamincanac',
avatar: {
src: 'https://github.com/benjamincanac.png',
loading: 'lazy'
},
to: 'https://x.com/benjamincanac',
target: '_blank'
},
{
name: 'Sebastien Chopin',
description: '@atinux',
avatar: {
src: 'https://github.com/atinux.png',
loading: 'lazy'
},
to: 'https://x.com/atinux',
target: '_blank'
},
{
name: 'Hugo Richard',
description: '@hugorcd',
avatar: {
src: 'https://github.com/hugorcd.png',
loading: 'lazy'
},
to: 'https://x.com/hugorcd',
target: '_blank'
}
]" :ui="{
container: 'max-w-lg'
}" class="w-full" date="2025-03-12" description="Nuxt UI v3 is out! After 1500+ commits, this major redesign brings improved accessibility, Tailwind CSS support, and full Vue compatibility." image="https://nuxt.com/assets/blog/nuxt-ui-v3.png" target="_blank" title="Introducing Nuxt UI v3" to="https://nuxt.com/blog/nuxt-ui-v3" />
</template>
[!TIP] See: /docs/components/changelog-versions
ChangelogVersions컴포넌트를 사용하면 여러 변경 로그 버전을 왼쪽 표시기 막대가 있는 타임라인으로 표시할 수 있어요.
제목 (Title)
title prop을 사용하면 ChangelogVersion의 제목을 표시할 수 있어요.
<template>
<UChangelogVersion title="Introducing Nuxt UI v3" />
</template>
설명 (Description)
description prop을 사용하면 ChangelogVersion의 설명을 표시할 수 있어요.
<template>
<UChangelogVersion title="Introducing Nuxt UI v3" description="Nuxt UI v3 is out! After 1500+ commits, this major redesign brings improved accessibility, Tailwind CSS support, and full Vue compatibility." />
</template>
날짜 (Date)
date prop을 사용하면 ChangelogVersion의 날짜를 표시할 수 있어요.
[!TIP]
날짜는 현재 로케일에 맞춰 자동으로 포맷됩니다.
Date객체나 문자열 중 원하는 형태로 전달할 수 있어요.
<template>
<UChangelogVersion title="Introducing Nuxt UI v3" description="Nuxt UI v3 is out! After 1500+ commits, this major redesign brings improved accessibility, Tailwind CSS support, and full Vue compatibility." date="2025-03-12" />
</template>
배지 (Badge)
badge prop을 사용하면 ChangelogVersion에 Badge를 표시할 수 있어요.
<template>
<UChangelogVersion title="Introducing Nuxt UI v3" description="Nuxt UI v3 is out! After 1500+ commits, this major redesign brings improved accessibility, Tailwind CSS support, and full Vue compatibility." date="2025-03-12" badge="Release" />
</template>
Badge 컴포넌트의 어떤 속성이든 넘겨서 배지를 커스터마이즈할 수 있어요.
<template>
<UChangelogVersion title="Introducing Nuxt UI v3" description="Nuxt UI v3 is out! After 1500+ commits, this major redesign brings improved accessibility, Tailwind CSS support, and full Vue compatibility." date="2025-03-12" :badge="{
label: 'Release',
color: 'primary',
variant: 'outline'
}" />
</template>
이미지 (Image)
image prop을 사용하면 BlogPost에 이미지를 표시할 수 있어요.
[!NOTE]
@nuxt/image가 설치되어 있으면 네이티브img태그 대신<NuxtImg>컴포넌트가 사용됩니다.
<template>
<UChangelogVersion title="Introducing Nuxt UI v3" description="Nuxt UI v3 is out! After 1500+ commits, this major redesign brings improved accessibility, Tailwind CSS support, and full Vue compatibility." date="2025-03-12" image="https://nuxt.com/assets/blog/nuxt-ui-v3.png" />
</template>
작성자 (Authors)
authors prop을 사용하면 ChangelogVersion에 User 목록을 표시할 수 있어요. 아래 속성들을 가진 객체 배열로 전달합니다:
name?: stringdescription?: stringavatar?: Omit<AvatarProps, 'size'>chip?: boolean | Omit<ChipProps, 'size' | 'inset'>size?: UserProps['size']orientation?: UserProps['orientation']
Link 컴포넌트의 to, target 같은 어떤 속성이든 전달할 수 있어요.
<script setup lang="ts">
import type { UserProps } from '@nuxt/ui'
const authors = ref<UserProps[]>([
{
name: "Benjamin Canac",
description: "@benjamincanac",
avatar: {
src: "https://github.com/benjamincanac.png",
loading: "lazy"
},
to: "https://x.com/benjamincanac",
target: "_blank"
},
{
name: "Sebastien Chopin",
description: "@atinux",
avatar: {
src: "https://github.com/atinux.png",
loading: "lazy"
},
to: "https://x.com/atinux",
target: "_blank"
},
{
name: "Hugo Richard",
description: "@hugorcd",
avatar: {
src: "https://github.com/hugorcd.png",
loading: "lazy"
},
to: "https://x.com/hugorcd",
target: "_blank"
}
])
</script>
<template>
<UChangelogVersion title="Introducing Nuxt UI v3" description="Nuxt UI v3 is out! After 1500+ commits, this major redesign brings improved accessibility, Tailwind CSS support, and full Vue compatibility." date="2025-03-12" image="https://nuxt.com/assets/blog/nuxt-ui-v3.png" :authors="authors" />
</template>
링크 (Link)
<NuxtLink> 컴포넌트의 to, target, rel 같은 어떤 속성이든 전달할 수 있어요.
<template>
<UChangelogVersion title="Introducing Nuxt UI v3" description="Nuxt UI v3 is out! After 1500+ commits, this major redesign brings improved accessibility, Tailwind CSS support, and full Vue compatibility." date="2025-03-12" image="https://nuxt.com/assets/blog/nuxt-ui-v3.png" to="https://nuxt.com/blog/nuxt-ui-v3" target="_blank" />
</template>
표시기 (Indicator)
indicator prop을 사용하면 왼쪽의 표시기 점을 숨길 수 있어요. 기본값은 true예요.
<template>
<UChangelogVersion title="Introducing Nuxt UI v3" description="Nuxt UI v3 is out! After 1500+ commits, this major redesign brings improved accessibility, Tailwind CSS support, and full Vue compatibility." date="2025-03-12" image="https://nuxt.com/assets/blog/nuxt-ui-v3.png" :indicator="false" />
</template>
[!NOTE]
indicatorprop이false면 날짜가 제목 위에 표시됩니다.
예시 (Examples)
body 슬롯 사용하기 (With body slot)
body 슬롯을 사용하면 이미지와 작성자 사이에 커스텀 콘텐츠를 표시할 수 있어요:
- 마크다운을 표시하려면
@comark/vue의 Markdown 컴포넌트를 사용하세요. - 페이지나 목록의 콘텐츠를 렌더링하려면
@nuxt/content의 ContentRenderer 컴포넌트를 사용하세요. - Nuxt UI는 사전 스타일링된 prose 컴포넌트를 제공하므로, 콘텐츠에서
body슬롯 안에 마크다운과 함께:u-changelog-version컴포넌트를 직접 사용할 수도 있어요.
<script setup lang="ts">
import { Markdown } from '@comark/vue'
const content = `

We are thrilled to introduce Nuxt UI v3, a comprehensive redesign of our UI library that delivers significant improvements in accessibility, performance, and developer experience. This major update represents over 1,500 commits of dedicated work, collaboration, and innovation from our team and the community.
Read the blog post announcement: https://nuxt.com/blog/nuxt-ui-v3
**[Get started with Nuxt UI v3 →](https://ui3.nuxt.com/getting-started/installation/nuxt)**
### 🧩 Reka UI: A New Foundation
We've transitioned from [Headless UI](https://headlessui.com/) to [Reka UI](https://reka-ui.com/) as our core component foundation, bringing:
- **Expanded Component Library**: Access to 55+ primitives, significantly expanding our component offerings
- **Future-Proof Development**: Benefit from Reka UI's growing popularity and continuous improvements
- **First-Class Accessibility**: Built-in accessibility features aligned with our commitment to inclusive design
### 🚀 Tailwind CSS Integration
Nuxt UI now leverages the latest [Tailwind CSS](https://tailwindcss.com), delivering:
- **Exceptional Performance**: Full builds up to 5× faster, with incremental builds over 100× faster
- **Streamlined Toolchain**: Built-in import handling, vendor prefixing, and syntax transforms with zero additional tooling
- **CSS-First Configuration**: Customize and extend the framework directly in CSS instead of JavaScript configuration
### 🎨 Tailwind Variants
We've adopted [Tailwind Variants](https://www.tailwind-variants.org/) to power our design system, offering:
- **Dynamic Styling**: Create flexible component variants with a powerful, intuitive API
- **Type Safety**: Full TypeScript support with intelligent auto-completion
- **Smart Conflict Resolution**: Efficiently merge conflicting styles with predictable results
## Migration from v2
We want to be transparent: migrating from Nuxt UI v2 to v3 requires significant effort. While we've maintained core concepts and components, Nuxt UI v3 has been rebuilt from the ground up to provide enhanced capabilities.
To upgrade your project:
1. Read our detailed [migration guide](https://ui3.nuxt.com/getting-started/migration)
2. Review the new documentation and components before attempting to upgrade
3. Report any issues on our [GitHub repository](https://github.com/nuxt/ui/issues)
## 🙏 Acknowledgements
This release represents thousands of hours of work from our team and the community. We'd like to thank everyone who contributed to making Nuxt UI v3 a reality, especially @romhml, @sandros94, and @hywax for their tremendous work.
`
const version = {
title: 'Introducing Nuxt UI v3',
description: 'Nuxt UI v3 is out! After 1500+ commits, this major redesign brings improved accessibility, Tailwind CSS support, and full Vue compatibility.',
date: '2025-03-12T00:00:00.000Z',
badge: 'Release',
to: 'https://nuxt.com/blog/nuxt-ui-v3',
target: '_blank',
content,
authors: [{
name: 'Benjamin Canac',
avatar: {
src: 'https://github.com/benjamincanac.png',
alt: 'Benjamin Canac',
loading: 'lazy' as const
},
to: 'https://github.com/benjamincanac',
target: '_blank'
}]
}
</script>
<template>
<UChangelogVersion v-bind="version" :ui="{ container: 'max-w-lg' }" class="w-full">
<template #body>
<Markdown :value="version.content" />
</template>
</UChangelogVersion>
</template>
API
Props
/**
* Props for the ChangelogVersion component
*/
interface ChangelogVersionProps {
/**
* The element or component this component should render as.
* @default 'article'
*/
as?: any;
title?: string | undefined;
description?: string | undefined;
/**
* The date of the changelog version. Can be a string or a Date object.
*/
date?: string | Date | undefined;
/**
* Display a badge on the changelog version.
* Can be a string or an object.
* `{ color: 'neutral', variant: 'solid' }`{lang="ts-type"}
*/
badge?: string | BadgeProps | undefined;
/**
* The authors of the changelog version.
*/
authors?: UserProps[] | undefined;
/**
* The image of the changelog version. Can be a string or an object.
*/
image?: string | Partial<ImgHTMLAttributes> & { [key: string]: any; } | undefined;
/**
* Display an indicator dot on the left.
* @default true
*/
indicator?: boolean | undefined;
to?: string | it | et | undefined;
target?: null | "_blank" | "_parent" | "_self" | "_top" | string & {} | undefined;
onClick?: (event: MouseEvent): void | undefined;
ui?: { root?: SlotClass; container?: SlotClass; header?: SlotClass; meta?: SlotClass; date?: SlotClass; badge?: SlotClass; title?: SlotClass; description?: SlotClass; imageWrapper?: SlotClass; image?: SlotClass; authors?: SlotClass; footer?: SlotClass; indicator?: SlotClass; dot?: SlotClass; dotInner?: SlotClass; } | undefined;
}
Slots
/**
* Slots for the ChangelogVersion component
*/
interface ChangelogVersionSlots {
header(): any;
badge(): any;
date(): any;
title(): any;
description(): any;
image(): any;
body(): any;
footer(): any;
authors(): any;
actions(): any;
indicator(): any;
}
테마 (Theme)
export default defineAppConfig({
ui: {
changelogVersion: {
slots: {
root: 'relative',
container: 'flex flex-col mx-auto max-w-2xl',
header: '',
meta: 'flex items-center gap-3 mb-2',
date: 'text-sm/6 text-toned truncate',
badge: '',
title: 'relative text-xl text-pretty font-semibold text-highlighted',
description: 'text-base text-pretty text-muted mt-1',
imageWrapper: 'relative overflow-hidden rounded-lg aspect-[16/9] mt-5 group/changelog-version-image',
image: 'object-cover object-top w-full h-full',
authors: 'flex flex-wrap gap-x-4 gap-y-1.5',
footer: 'border-t border-default pt-5 flex items-center justify-between',
indicator: 'absolute start-0 top-0 w-32 hidden lg:flex items-center justify-end gap-3 min-w-0',
dot: 'size-4 rounded-full bg-default ring ring-default flex items-center justify-center my-1',
dotInner: 'size-2 rounded-full bg-primary'
},
variants: {
body: {
false: {
footer: 'mt-5'
}
},
badge: {
false: {
meta: 'lg:hidden'
}
},
to: {
true: {
title: [
'outline-primary/25 has-focus-visible:outline-3 rounded-xs',
'transition'
],
image: 'transform transition-transform ease-out motion-reduce:transition-none group-hover/changelog-version-image:scale-105 group-has-focus-visible/changelog-version-image:scale-105'
}
},
hidden: {
true: {
date: 'lg:hidden'
}
}
}
}
}
})