Skip to content

KLongText

示例

Long text with tooltip

This is a very long text that will be truncated when it overflows its container width

Short text (no tooltip)

Short text

Truncates long text and shows a tooltip with the full content when it overflows.

Props

NameTypeDefaultDescription
maxLengthnumber50Reserved for future use. Truncation is CSS-based.
classstringAdditional CSS classes for the root element.

Emits

NameParametersDescription
This component does not emit custom events.

Slots

NameDescription
defaultThe text content to display. Will be truncated with ellipsis if it overflows.

Basic Usage

vue
<script setup>
import { KLongText } from '@kK-2004/ui-component'
</script>

<template>
  <KLongText class="max-w-[200px]">
    This is a very long text that will be truncated with a tooltip showing the full content.
  </KLongText>
</template>