Skip to content

描述

基于 naive-ui 的descriptions二次封装。

INFO

无需引入,可直接使用

Usage

vue
<template>
  <w-descriptions :items="descriptionsItem" />
</template>

Props

名称类型默认值说明
itemsWDescriptionsItem[][]描述内容数组

Type

ts
import type {
  DescriptionItemProps,
  DescriptionProps,
  TagProps,
  TextProps,
} from 'naive-ui'

import { props } from './props'

// tag类型的描述
interface WDescTypeTag {
  type: 'tag'
  typeProps: TagProps
}

// 链接类型的描述
interface WDescTypeLink {
  type: 'link'
  typeProps: TextProps & {
    link: string
  }
}

// 描述的内容
interface WDescValue {
  value: StringOrNumber
}

export type WDescriptionsItem = DescriptionItemProps &
Partial<WDescTypeTag | WDescTypeLink> &
WDescValue

type ExtendProps = Partial<ExtractPropTypes<typeof props>>

export interface WDescriptionProps extends DescriptionProps, ExtendProps {}

Released under the MIT License.