From abb1bd5dfd26b5fb8b52b90a48d1269820d33cc9 Mon Sep 17 00:00:00 2001 From: Aresn Date: Mon, 27 Jun 2022 11:00:27 +0800 Subject: [PATCH] fix types problem --- types/affix.d.ts | 14 +- types/alert.d.ts | 26 +-- types/anchor.d.ts | 34 ++-- types/auth.d.ts | 32 ++-- types/auto-complete.d.ts | 46 ++--- types/avatar-list.d.ts | 22 ++- types/avatar.d.ts | 18 +- types/back-top.d.ts | 16 +- types/badge.d.ts | 32 ++-- types/breadcrumb.d.ts | 20 +- types/button.d.ts | 49 ++--- types/calendar.d.ts | 40 ++-- types/card.d.ts | 34 ++-- types/carousel.d.ts | 38 ++-- types/cascader.d.ts | 42 +++-- types/cell.d.ts | 44 ++--- types/checkbox.d.ts | 34 ++-- types/circle.d.ts | 26 +-- types/city.d.ts | 28 +-- types/collapse.d.ts | 28 +-- types/color-picker.d.ts | 38 ++-- types/count-down.d.ts | 14 +- types/count-up.d.ts | 18 +- types/date-picker.d.ts | 72 +++---- types/description-list.d.ts | 32 ++-- types/divider.d.ts | 16 +- types/drawer.d.ts | 58 +++--- types/dropdown.d.ts | 54 +++--- types/ellipsis.d.ts | 32 ++-- types/exception.d.ts | 28 +-- types/footer-toolbar.d.ts | 8 +- types/form.d.ts | 54 +++--- types/global-footer.d.ts | 32 ++-- types/grid.d.ts | 26 +-- types/icon.d.ts | 14 +- types/image.d.ts | 78 ++++---- types/index.d.ts | 40 ++-- types/input-number.d.ts | 42 +++-- types/input.d.ts | 84 +++++---- types/layout.d.ts | 60 +++--- types/list.d.ts | 56 +++--- types/loading-bar.d.ts | 16 +- types/login.d.ts | 88 ++++----- types/menu.d.ts | 54 +++--- types/message.d.ts | 24 +-- types/modal.d.ts | 96 +++++----- types/notice.d.ts | 24 +-- types/notification.d.ts | 130 ++++++------- types/number-info.d.ts | 28 +-- types/numeral.d.ts | 22 ++- types/page-header.d.ts | 46 ++--- types/page.d.ts | 52 +++--- types/poptip.d.ts | 56 +++--- types/progress.d.ts | 26 +-- types/radio.d.ts | 38 ++-- types/rate.d.ts | 26 +-- types/result.d.ts | 24 +-- types/row.d.ts | 46 ++--- types/scroll.d.ts | 18 +- types/select.d.ts | 90 ++++----- types/skeleton.d.ts | 42 +++-- types/slider.d.ts | 36 ++-- types/space.d.ts | 24 +-- types/spin.d.ts | 16 +- types/split.d.ts | 32 ++-- types/steps.d.ts | 34 ++-- types/switch.d.ts | 32 ++-- types/table-paste.d.ts | 24 +-- types/table.d.ts | 166 ++++++++-------- types/tabs.d.ts | 60 +++--- types/tag-select.d.ts | 26 +-- types/tag.d.ts | 24 +-- types/time-picker.d.ts | 56 +++--- types/time.d.ts | 14 +- types/timeline.d.ts | 20 +- types/tooltip.d.ts | 40 ++-- types/transfer.d.ts | 38 ++-- types/tree-select.d.ts | 22 ++- types/tree.d.ts | 62 +++--- types/trend.d.ts | 14 +- types/typography.d.ts | 312 ++++++++++++++++--------------- types/upload.d.ts | 58 +++--- types/viewuiplus.components.d.ts | 4 +- types/word-count.d.ts | 34 ++-- 84 files changed, 1876 insertions(+), 1697 deletions(-) diff --git a/types/affix.d.ts b/types/affix.d.ts index f00ecc1d1..4a06a85b6 100644 --- a/types/affix.d.ts +++ b/types/affix.d.ts @@ -1,22 +1,24 @@ -export declare class Affix { +import type { DefineComponent } from 'vue'; + +export declare const Affix: DefineComponent<{ /** * 距离窗口顶部达到指定偏移量后触发 */ - 'offset-top': number; + 'offset-top'?: number; /** * 距离窗口底部达到指定偏移量后触发 */ - 'offset-bottom': number; + 'offset-bottom'?: number; /** * addEventListener 原生的 useCapture 选项 */ - 'use-capture': boolean; + 'use-capture'?: boolean; /** * 在固定状态发生改变时触发 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; -} +}> diff --git a/types/alert.d.ts b/types/alert.d.ts index aa64f9dc2..fd0fa6bbc 100644 --- a/types/alert.d.ts +++ b/types/alert.d.ts @@ -1,49 +1,51 @@ -export declare class Alert { +import type { DefineComponent } from 'vue'; + +export declare const Alert: DefineComponent<{ /** * 警告提示样式,可选值为`info`、`success`、`warning`、`error` */ - type: 'info' | 'success' | 'warning' | 'error'; + type?: 'info' | 'success' | 'warning' | 'error'; /** * 是否可关闭 */ - closable: boolean; + closable?: boolean; /** * 是否显示图标 */ - 'show-icon': boolean; + 'show-icon'?: boolean; /** * 是否应用动画,动画时长可能会引起占位的闪烁 */ - fade: boolean; + fade?: boolean; /** * 关闭时触发 */ - $emit(eventName: 'on-close'): this; + onOnClose?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 警告提示内容 */ - '': []; + default?: () => any; /** * 警告提示辅助性文字介绍 */ - desc: []; + desc?: () => any; /** * 自定义图标内容 */ - icon: []; + icon?: () => any; /** * 自定义关闭内容 */ - close: []; + close?: () => any; }; -} +}> diff --git a/types/anchor.d.ts b/types/anchor.d.ts index cee75e19f..6d760581a 100644 --- a/types/anchor.d.ts +++ b/types/anchor.d.ts @@ -1,65 +1,67 @@ -export declare class Anchor { +import type { DefineComponent } from 'vue'; + +export declare const Anchor: DefineComponent<{ /** * 固定模式 */ - affix: boolean; + affix?: boolean; /** * 距离窗口顶部达到指定偏移量后触发 */ - 'offset-top': number; + 'offset-top'?: number; /** * 距离窗口底部达到指定偏移量后触发 */ - 'offset-bottom': number; + 'offset-bottom'?: number; /** * 锚点区域边界,单位:px */ - bounds: number; + bounds?: number; /** * 点击滚动的额外距离 */ - 'scroll-offset': number; + 'scroll-offset'?: number; /** * 指定滚动的容器 */ - container: string | HTMLElement; + container?: string | HTMLElement; /** * 是否显示小圆点 */ - 'show-ink': boolean; + 'show-ink'?: boolean; /** * 点击锚点时触发,返回链接 */ - $emit(eventName: 'on-select'): this; + onOnSelect?: (event?: any) => any; /** * 链接改变时触发,返回新链接和旧链接 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; -} +}> -export declare class AnchorLink { +export declare const AnchorLink: DefineComponent<{ /** * 锚点链接 */ - href: string; + href?: string; /** * 文字内容 */ - title: string; + title?: string; /** * 点击滚动的额外距离 */ - 'scroll-offset': number; + 'scroll-offset'?: number; -} +}> diff --git a/types/auth.d.ts b/types/auth.d.ts index 817263dbf..488bc79d4 100644 --- a/types/auth.d.ts +++ b/types/auth.d.ts @@ -1,64 +1,66 @@ -export declare class Auth { +import type { DefineComponent } from 'vue'; + +export declare const Auth: DefineComponent<{ /** * 准入权限,详见示例 */ - authority: string | [] | Function | boolean; + authority?: string | any[] | Function | boolean; /** * 用户权限 */ - access: string | []; + access?: string | any[]; /** * 是否开启阻止模式,开启后,不会返回 noMatch 的 slot,而是阻止组件内的点击,反而给一个 $Message 提示,常用于 Button 操作 */ - prevent: boolean; + prevent?: boolean; /** * 在 prevent 开启时有效,点击提示的内容,当开启 custom-tip 时无效 */ - message: string; + message?: string; /** * 在 prevent 开启时有效,通过监听 @click 自定义提示 */ - 'custom-tip': boolean; + 'custom-tip'?: boolean; /** * 设置包裹组件的 display 类型,包裹组件是一个 div 元素 */ - display: string; + display?: string; /** * 开启后,当鉴权不通过时,直接跳转到指定路由 */ - to: object | string; + to?: object | string; /** * 路由跳转时,开启 replace 将不会向 history 添加新记录 */ - replace: boolean; + replace?: boolean; /** * 同 vue-router append */ - append: boolean; + append?: boolean; /** * 当开启 prevent,且鉴权不通过时,点击会触发 */ - $emit(eventName: 'click'): this; + onClick?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 自定义标题 */ - default: []; + default?: () => any; /** * 自定义补充描述 */ - noMatch: []; + noMatch?: () => any; }; -} +}> diff --git a/types/auto-complete.d.ts b/types/auto-complete.d.ts index e570a1ee8..eb4a4bd0c 100644 --- a/types/auto-complete.d.ts +++ b/types/auto-complete.d.ts @@ -1,102 +1,104 @@ -export declare class AutoComplete { +import type { DefineComponent } from 'vue'; + +export declare const AutoComplete: DefineComponent<{ /** * 绑定的值,可使用 v-model 双向绑定 */ - 'model-value': string | number; + 'model-value'?: string | number; /** * 自动完成的数据源 */ - data: []; + data?: any[]; /** * 是否可以清空选项 */ - clearable: boolean; + clearable?: boolean; /** * 是否禁用 */ - disabled: boolean; + disabled?: boolean; /** * 占位文本 */ - placeholder: string; + placeholder?: string; /** * 输入框尺寸,可选值为 `large`、`small`、`default` 或者不设置 */ - size: '' | 'large' | 'small' | 'default'; + size?: '' | 'large' | 'small' | 'default'; /** * 输入框尾部图标 */ - icon: string; + icon?: string; /** * 是否根据输入项进行筛选。当其为一个函数时,会接收 `value` 和 `option` 两个参数,当 option 符合筛选条件时,应返回 true,反之则返回 false */ - 'filter-method': Function | boolean; + 'filter-method'?: Function | boolean; /** * 弹窗的展开方向,可选值为 `bottom`、`top`、`top-start`、`bottom-start`、`top-end`、`bottom-end`,2.12.0 版本开始支持自动识别 */ - placement: string; + placement?: string; /** * 是否将弹层放置于 body 内,在 Tabs、带有 fixed 的 Table 列内使用时,建议添加此属性,它将不受父级样式影响,从而达到更好的效果 */ - transfer: boolean; + transfer?: boolean; /** * 给表单元素设置 `id`,详见 Form 用法。 */ - 'element-id': string; + 'element-id'?: string; /** * 开启 transfer 时,给浮层添加额外的 class 名称 */ - 'transfer-class-name': string; + 'transfer-class-name'?: string; /** * 是否开启 capture 模式,也可通过全局配置 */ - capture: boolean; + capture?: boolean; /** * 是否开启 Popper 的 eventsEnabled 属性,开启可能会牺牲一定的性能 */ - 'events-enabled': boolean; + 'events-enabled'?: boolean; /** * 选中 option,或 input 的 value 变化时,调用此函数 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; /** * 被选中时调用,参数为选中项的 value 值 */ - $emit(eventName: 'on-select'): this; + onOnSelect?: (event?: any) => any; /** * 搜索补全项的时候调用 */ - $emit(eventName: 'on-search'): this; + onOnSearch?: (event?: any) => any; /** * 聚焦时触发 */ - $emit(eventName: 'on-focus'): this; + onOnFocus?: (event?: any) => any; /** * 失焦时触发 */ - $emit(eventName: 'on-blur'): this; + onOnBlur?: (event?: any) => any; /** * 清空时触发 */ - $emit(eventName: 'on-clear'): this; + onOnClear?: (event?: any) => any; -} +}> diff --git a/types/avatar-list.d.ts b/types/avatar-list.d.ts index ed9f040a4..f30ccc0a8 100644 --- a/types/avatar-list.d.ts +++ b/types/avatar-list.d.ts @@ -1,39 +1,41 @@ -export declare class AvatarList { +import type { DefineComponent } from 'vue'; + +export declare const AvatarList: DefineComponent<{ /** * 指定头像的形状,可选值为 circle、square */ - shape: 'circle' | 'square'; + shape?: 'circle' | 'square'; /** * 设置头像的大小,可选值为 large、small、default */ - size: 'large' | 'small' | 'default'; + size?: 'large' | 'small' | 'default'; /** * 图片类头像的资源地址 */ - src: string; + src?: string; /** * 设置头像的图标类型,参考 `Icon` 组件 */ - icon: string; + icon?: string; /** * 自定义图标 */ - 'custom-icon': string; + 'custom-icon'?: string; - $slots: { + 'v-slots'?: { /** * 自定义超出 max 后的内容 */ - excess: []; + excess?: () => any; /** * 指定该 slot 后,无论超出 max 与否,都会显示自定义的额外信息,且 excess 失效 */ - extra: []; + extra?: () => any; }; -} +}> diff --git a/types/avatar.d.ts b/types/avatar.d.ts index 955bbe91d..4d9ef2e26 100644 --- a/types/avatar.d.ts +++ b/types/avatar.d.ts @@ -1,32 +1,34 @@ -export declare class Avatar { +import type { DefineComponent } from 'vue'; + +export declare const Avatar: DefineComponent<{ /** * 指定头像的形状,可选值为 circle、square */ - shape: 'circle' | 'square'; + shape?: 'circle' | 'square'; /** * 设置头像的大小,可选值为 large、small、default */ - size: 'large' | 'small' | 'default'; + size?: 'large' | 'small' | 'default'; /** * 图片类头像的资源地址 */ - src: string; + src?: string; /** * 设置头像的图标类型,参考 `Icon` 组件 */ - icon: string; + icon?: string; /** * 自定义图标 */ - 'custom-icon': string; + 'custom-icon'?: string; /** * 在设置 src 且图片加载不成功时触发 */ - $emit(eventName: 'on-error'): this; + onOnError?: (event?: any) => any; -} +}> diff --git a/types/back-top.d.ts b/types/back-top.d.ts index 90f06e3d1..14b8e8777 100644 --- a/types/back-top.d.ts +++ b/types/back-top.d.ts @@ -1,27 +1,29 @@ -export declare class BackTop { +import type { DefineComponent } from 'vue'; + +export declare const BackTop: DefineComponent<{ /** * 页面滚动高度达到该值时才显示`BackTop`组件 */ - height: number; + height?: number; /** * 组件距离底部的距离 */ - bottom: number; + bottom?: number; /** * 组件距离右部的距离 */ - right: number; + right?: number; /** * 滚动动画持续时间,单位 毫秒 */ - duration: number; + duration?: number; /** * 点击按钮时触发 */ - $emit(eventName: 'on-click'): this; + onOnClick?: (event?: any) => any; -} +}> diff --git a/types/badge.d.ts b/types/badge.d.ts index 0ec809656..20fa7c081 100644 --- a/types/badge.d.ts +++ b/types/badge.d.ts @@ -1,64 +1,66 @@ -export declare class Badge { +import type { DefineComponent } from 'vue'; + +export declare const Badge: DefineComponent<{ /** * 显示的数字,大于`overflowCount`时,显示`${overflowCount}+`,为 0 时隐藏 */ - count: number; + count?: number; /** * 展示封顶的数字值 */ - 'overflow-count': number | string; + 'overflow-count'?: number | string; /** * 不展示数字,只有一个小红点,如需隐藏 dot ,需要设置`count`为 0 */ - dot: boolean; + dot?: boolean; /** * 自定义的class名称,dot 模式下无效 */ - 'class-name': string; + 'class-name'?: string; /** * 使用预设的颜色,可选值为 success、primary、normal、error、warning、info */ - type: 'success' | 'primary' | 'normal' | 'error' | 'warning' | 'info'; + type?: 'success' | 'primary' | 'normal' | 'error' | 'warning' | 'info'; /** * 当数值为 0 时,是否展示 Badge */ - 'show-zero': boolean; + 'show-zero'?: boolean; /** * 设置 Badge 为状态点,可选值为 success、processing、default、error、warning */ - status: 'success' | 'processing' | 'default' | 'error' | 'warning'; + status?: 'success' | 'processing' | 'default' | 'error' | 'warning'; /** * 自定义内容,如果设置了 status,则为状态点的文本 */ - text: string; + text?: string; /** * 设置状态点的位置偏移,格式为 [x, y] */ - offset: []; + offset?: any[]; /** * 设置更多状态点的颜色或自定义颜色 */ - color: string; + color?: string; - $slots: { + 'v-slots'?: { /** * 自定义角标显示内容(去角标背景),数值 count 将无效。 */ - count: []; + count?: () => any; /** * 自定义角标显示内容(带角标背景),数值 count 将无效。亦可自定义状态点模式下的 text 内容。 */ - text: []; + text?: () => any; }; -} +}> diff --git a/types/breadcrumb.d.ts b/types/breadcrumb.d.ts index 040112646..abb88b43b 100644 --- a/types/breadcrumb.d.ts +++ b/types/breadcrumb.d.ts @@ -1,30 +1,32 @@ -export declare class Breadcrumb { +import type { DefineComponent } from 'vue'; + +export declare const Breadcrumb: DefineComponent<{ /** * 自定义分隔符 */ - separator: string | Element; + separator?: string | Element; -} +}> -export declare class BreadcrumbItem { +export declare const BreadcrumbItem: DefineComponent<{ /** * 链接,不传则没有链接,支持 vue-router 对象 */ - to: string | object; + to?: string | object; /** * 路由跳转时,开启 replace 将不会向 history 添加新记录 */ - replace: boolean; + replace?: boolean; /** * 相当于 a 链接的 target 属性 */ - target: '_blank' | '_self' | '_parent' | '_top'; + target?: '_blank' | '_self' | '_parent' | '_top'; /** * 同 vue-router append */ - append: boolean; + append?: boolean; -} +}> diff --git a/types/button.d.ts b/types/button.d.ts index b5ab12205..064303cb5 100644 --- a/types/button.d.ts +++ b/types/button.d.ts @@ -1,90 +1,97 @@ -export declare class Button { +import type { DefineComponent } from 'vue'; + +export declare const Button: DefineComponent<{ /** * 按钮类型,可选值为 `default`、`primary`、`dashed`、`text`、`info`、`success`、`warning`、`error`或者不设置 */ - type: '' | 'default' | 'primary' | 'dashed' | 'text' | 'info' | 'success' | 'warning' | 'error'; + type?: '' | 'default' | 'primary' | 'dashed' | 'text' | 'info' | 'success' | 'warning' | 'error'; /** * 幽灵属性,使按钮背景透明 */ - ghost: boolean; + ghost?: boolean; /** * 按钮大小,可选值为 `large`、`small`、`default` 或者不设置 */ - size: '' | 'large' | 'small' | 'default'; + size?: '' | 'large' | 'small' | 'default'; /** * 按钮形状,可选值为 `circle` 或者不设置 */ - shape: string; + shape?: string; /** * 开启后,按钮的长度为 100% */ - long: boolean; + long?: boolean; /** * 设置 `button` 原生的 `type`,可选值为 `button`、`submit`、`reset` */ - 'html-type': 'button' | 'submit' | 'reset'; + 'html-type'?: 'button' | 'submit' | 'reset'; /** * 设置按钮为禁用状态 */ - disabled: boolean; + disabled?: boolean; /** * 设置按钮为加载中状态 */ - loading: boolean; + loading?: boolean; /** * 设置按钮的图标类型 */ - icon: string; + icon?: string; /** * 设置按钮的自定义图标 */ - 'custom-icon': string; + 'custom-icon'?: string; /** * 跳转的链接,支持 vue-router 对象 */ - to: string | object; + to?: string | object; /** * 路由跳转时,开启 replace 将不会向 history 添加新记录 */ - replace: boolean; + replace?: boolean; /** * 相当于 a 链接的 target 属性 */ - target: '_blank' | '_self' | '_parent' | '_top'; + target?: '_blank' | '_self' | '_parent' | '_top'; /** * 同 vue-router append */ - append: boolean; + append?: boolean; + + /** + * 点击时触发 + */ + onClick?: (event?: any) => any; -} +}> -export declare class ButtonGroup { +export declare const ButtonGroup: DefineComponent<{ /** * 按钮组合大小,可选值为 `large`、`small`、`default` 或者不设置 */ - size: 'large' | 'small' | 'default'; + size?: 'large' | 'small' | 'default'; /** * 按钮组合形状,可选值为 `circle` 或者不设置 */ - shape: '' | 'circle'; + shape?: '' | 'circle'; /** * 是否纵向排列按钮组 */ - vertical: boolean; + vertical?: boolean; -} +}> diff --git a/types/calendar.d.ts b/types/calendar.d.ts index cd26eb655..3ba744faf 100644 --- a/types/calendar.d.ts +++ b/types/calendar.d.ts @@ -1,84 +1,86 @@ -export declare class Calendar { +import type { DefineComponent } from 'vue'; + +export declare const Calendar: DefineComponent<{ /** * 绑定当前日期的值,为空时默认显示今天,可使用 v-model 双向绑定数据 */ - 'model-value': Date | string | number; + 'model-value'?: Date | string | number; /** * 视图类型,可选值为 month (月视图) 或 year (年视图) */ - type: string; + type?: string; /** * 单元格高度,单位 px */ - 'cell-height': number; + 'cell-height'?: number; /** * 是否显示顶部 */ - 'show-header': boolean; + 'show-header'?: boolean; /** * 周起始日 */ - 'first-day-of-week': number; + 'first-day-of-week'?: number; /** * 是否隐藏类型切换 */ - 'hide-type': boolean; + 'hide-type'?: boolean; /** * 默认文案 */ - locale: object; + locale?: object; /** * 选择日期发生变化时触发 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; /** * 切换视图类型时触发 */ - $emit(eventName: 'on-type-change'): this; + onOnTypeChange?: (event?: any) => any; /** * 点击单元格时触发 */ - $emit(eventName: 'on-cell-click'): this; + onOnCellClick?: (event?: any) => any; /** * 右键单元格时触发 */ - $emit(eventName: 'on-cell-contextmenu'): this; + onOnCellContextmenu?: (event?: any) => any; /** * 切换上一个时触发 */ - $emit(eventName: 'on-prev'): this; + onOnPrev?: (event?: any) => any; /** * 切换下一个时触发 */ - $emit(eventName: 'on-next'): this; + onOnNext?: (event?: any) => any; /** * 点击今日时触发 */ - $emit(eventName: 'on-today'): this; + onOnToday?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 自定义顶部 */ - header: []; + header?: () => any; /** * 自定义顶部标题 */ - headerTitle: []; + headerTitle?: () => any; }; -} +}> diff --git a/types/card.d.ts b/types/card.d.ts index 6ec948733..ee495fd7f 100644 --- a/types/card.d.ts +++ b/types/card.d.ts @@ -1,69 +1,71 @@ -export declare class Card { +import type { DefineComponent } from 'vue'; + +export declare const Card: DefineComponent<{ /** * 是否显示边框,建议在灰色背景下使用 */ - bordered: boolean; + bordered?: boolean; /** * 禁用鼠标悬停显示阴影 */ - 'dis-hover': boolean; + 'dis-hover'?: boolean; /** * 卡片阴影,建议在灰色背景下使用 */ - shadow: boolean; + shadow?: boolean; /** * 卡片内部间距,单位 px */ - padding: number; + padding?: number; /** * 标题 */ - title: string; + title?: string; /** * 标题前的图标 */ - icon: string; + icon?: string; /** * 跳转的链接,支持 vue-router 对象 */ - to: string | object; + to?: string | object; /** * 路由跳转时,开启 replace 将不会向 history 添加新记录 */ - replace: boolean; + replace?: boolean; /** * 相当于 a 链接的 target 属性 */ - target: string; + target?: string; /** * 同 vue-router append */ - append: boolean; + append?: boolean; - $slots: { + 'v-slots'?: { /** * 自定义卡片标题,如果是简单文字,可以使用`<p>`标签包裹 */ - title: []; + title?: () => any; /** * 额外显示的内容,默认位置在右上角 */ - extra: []; + extra?: () => any; /** * 卡片主体内容 */ - '': []; + default?: () => any; }; -} +}> diff --git a/types/carousel.d.ts b/types/carousel.d.ts index e32e499fa..9686427ec 100644 --- a/types/carousel.d.ts +++ b/types/carousel.d.ts @@ -1,72 +1,74 @@ -export declare class Carousel { +import type { DefineComponent } from 'vue'; + +export declare const Carousel: DefineComponent<{ /** * 幻灯片的索引,从 0 开始,可以使用 v-model 双向绑定数据 */ - 'model-value': number; + 'model-value'?: number; /** * 走马灯的高度,可填 auto 或具体高度数值,单位 px */ - height: string | number; + height?: string | number; /** * 是否开启循环 */ - loop: boolean; + loop?: boolean; /** * 是否自动切换 */ - autoplay: boolean; + autoplay?: boolean; /** * 自动切换的时间间隔,单位为毫秒 */ - 'autoplay-speed': number; + 'autoplay-speed'?: number; /** * 指示器的位置,可选值为 inside (内部),outside(外部),none(不显示) */ - dots: 'inside' | 'outside' | 'none'; + dots?: 'inside' | 'outside' | 'none'; /** * 是否显示圆形指示器 */ - 'radius-dot': boolean; + 'radius-dot'?: boolean; /** * 指示器的触发方式,可选值为 click(点击),hover(悬停) */ - trigger: 'click' | 'hover'; + trigger?: 'click' | 'hover'; /** * 切换箭头的显示时机,可选值为 hover(悬停),always(一直显示),never(不显示) */ - arrow: 'hover' | 'always' | 'never'; + arrow?: 'hover' | 'always' | 'never'; /** * 动画效果 */ - easing: string; + easing?: string; /** * 幻灯片切换时触发,目前激活的幻灯片的索引,原幻灯片的索引 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; /** * 点击幻灯片时触发,返回索引值 */ - $emit(eventName: 'on-click'): this; + onOnClick?: (event?: any) => any; -} +}> -export declare class CarouselItem { - $slots: { +export declare const CarouselItem: DefineComponent<{ + 'v-slots'?: { /** * 默认插槽内容 */ - default: []; + default?: () => any; }; -} +}> diff --git a/types/cascader.d.ts b/types/cascader.d.ts index eb3700502..f02552086 100644 --- a/types/cascader.d.ts +++ b/types/cascader.d.ts @@ -1,92 +1,94 @@ -export declare class Cascader { +import type { DefineComponent } from 'vue'; + +export declare const Cascader: DefineComponent<{ /** * 可选项的数据源,格式参照示例说明 */ - data: []; + data?: any[]; /** * 当前已选项的数据,格式参照示例说明 */ - 'model-value': []; + 'model-value'?: any[]; /** * 选择后展示的函数,用于自定义显示格式 */ - 'render-format': Function; + 'render-format'?: Function; /** * 是否禁用选择器 */ - disabled: boolean; + disabled?: boolean; /** * 是否支持清除 */ - clearable: boolean; + clearable?: boolean; /** * 输入框占位符 */ - placeholder: string; + placeholder?: string; /** * 次级菜单展开方式,可选值为 `click` 或 `hover` */ - trigger: 'click' | 'hover'; + trigger?: 'click' | 'hover'; /** * 当此项为 true 时,点选每级菜单选项值都会发生变化,具体见上面的示例 */ - 'change-on-select': boolean; + 'change-on-select'?: boolean; /** * 输入框大小,可选值为`large`和`small`或者不填 */ - size: '' | 'large' | 'small'; + size?: '' | 'large' | 'small'; /** * 动态获取数据,数据源需标识 loading */ - 'load-data': Function; + 'load-data'?: Function; /** * 是否支持搜索 */ - filterable: boolean; + filterable?: boolean; /** * 当搜索列表为空时显示的内容 */ - 'not-found-text': string; + 'not-found-text'?: string; /** * 是否将弹层放置于 body 内,在 Tabs、带有 fixed 的 Table 列内使用时,建议添加此属性,它将不受父级样式影响,从而达到更好的效果 */ - transfer: boolean; + transfer?: boolean; /** * 给表单元素设置 `id`,详见 Form 用法。 */ - 'element-id': string; + 'element-id'?: string; /** * 开启 transfer 时,给浮层添加额外的 class 名称 */ - 'transfer-class-name': string; + 'transfer-class-name'?: string; /** * 是否开启 Popper 的 eventsEnabled 属性,开启可能会牺牲一定的性能 */ - 'events-enabled': boolean; + 'events-enabled'?: boolean; /** * 选择完成后的回调,返回值 value 即已选值 value,selectedData 为已选项的具体数据 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; /** * 展开和关闭弹窗时触发 */ - $emit(eventName: 'on-visible-change'): this; + onOnVisibleChange?: (event?: any) => any; -} +}> diff --git a/types/cell.d.ts b/types/cell.d.ts index 23f21317e..34cf8f450 100644 --- a/types/cell.d.ts +++ b/types/cell.d.ts @@ -1,87 +1,89 @@ -export declare class Cell { +import type { DefineComponent } from 'vue'; + +export declare const Cell: DefineComponent<{ /** * 用来标识这一项 */ - name: string | number; + name?: string | number; /** * 左侧标题 */ - title: string; + title?: string; /** * 标题下方的描述信息 */ - label: string; + label?: string; /** * 右侧额外内容 */ - extra: string; + extra?: string; /** * 禁用该项 */ - disabled: boolean; + disabled?: boolean; /** * 标记该项为选中状态 */ - selected: boolean; + selected?: boolean; /** * 跳转的链接,支持 vue-router 对象 */ - to: string | object; + to?: string | object; /** * 路由跳转时,开启 replace 将不会向 history 添加新记录 */ - replace: boolean; + replace?: boolean; /** * 相当于 a 链接的 target 属性 */ - target: '_blank' | '_self' | '_parent' | '_top'; + target?: '_blank' | '_self' | '_parent' | '_top'; /** * 同 vue-router append */ - append: boolean; + append?: boolean; - $slots: { + 'v-slots'?: { /** * 相当于 title */ - '': []; + default?: () => any; /** * 标题前的 Icon */ - icon: []; + icon?: () => any; /** * 相当于 label */ - label: []; + label?: () => any; /** * 相当于 extra */ - extra: []; + extra?: () => any; /** * 有链接时,可自定义右侧箭头 */ - arrow: []; + arrow?: () => any; }; -} +}> -export declare class CellGroup { +export declare const CellGroup: DefineComponent<{ /** * 点击单元格时触发 */ - $emit(eventName: 'on-click'): this; + onOnClick?: (event?: any) => any; -} +}> diff --git a/types/checkbox.d.ts b/types/checkbox.d.ts index 561f6300b..574c548e7 100644 --- a/types/checkbox.d.ts +++ b/types/checkbox.d.ts @@ -1,65 +1,67 @@ -export declare class Checkbox { +import type { DefineComponent } from 'vue'; + +export declare const Checkbox: DefineComponent<{ /** * 只在单独使用时有效。可以使用 v-model 双向绑定数据 */ - 'model-value': boolean; + 'model-value'?: boolean; /** * 只在组合使用时有效。指定当前选项的 value 值,组合会自动判断是否选中 */ - label: string; + label?: string; /** * 是否禁用当前项 */ - disabled: boolean; + disabled?: boolean; /** * 设置 indeterminate 状态,只负责样式控制 */ - indeterminate: boolean; + indeterminate?: boolean; /** * 多选框的尺寸,可选值为 `large`、`small`、`default` 或者不设置 */ - size: '' | 'large' | 'small' | 'default'; + size?: '' | 'large' | 'small' | 'default'; /** * 是否显示边框 */ - border: boolean; + border?: boolean; /** * 选中时的值,当使用类似 1 和 0 来判断是否选中时会很有用 */ - 'true-value': string | number | boolean; + 'true-value'?: string | number | boolean; /** * 没有选中时的值,当使用类似 1 和 0 来判断是否选中时会很有用 */ - 'false-value': string | number | boolean; + 'false-value'?: string | number | boolean; /** * 只在单独使用时有效。在选项状态发生改变时触发,通过修改外部的数据改变时不会触发 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; -} +}> -export declare class CheckboxGroup { +export declare const CheckboxGroup: DefineComponent<{ /** * 指定选中项目的集合,可以使用 v-model 双向绑定数据 */ - 'model-value': []; + 'model-value'?: any[]; /** * 多选框组的尺寸,可选值为 `large`、`small`、`default` 或者不设置 */ - size: '' | 'large' | 'small' | 'default'; + size?: '' | 'large' | 'small' | 'default'; /** * 在选项状态发生改变时触发,返回已选中的数组。通过修改外部的数据改变时不会触发 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; -} +}> diff --git a/types/circle.d.ts b/types/circle.d.ts index 2ea7b123f..eea76212c 100644 --- a/types/circle.d.ts +++ b/types/circle.d.ts @@ -1,49 +1,51 @@ -export declare class Circle { +import type { DefineComponent } from 'vue'; + +export declare const Circle: DefineComponent<{ /** * 百分比 */ - percent: number; + percent?: number; /** * 图表的宽度和高度,单位 px */ - size: number; + size?: number; /** * 进度环顶端的形状,可选值为`square`(方)和`round`(圆) */ - 'stroke-linecap': 'square' | 'round'; + 'stroke-linecap'?: 'square' | 'round'; /** * 进度环的线宽,单位 px */ - 'stroke-width': number; + 'stroke-width'?: number; /** * 进度环的颜色,4.0.0 版本开始支持传入数组显示为渐变色 */ - 'stroke-color': string | []; + 'stroke-color'?: string | any[]; /** * 进度环背景的线宽,单位 px */ - 'trail-width': number; + 'trail-width'?: number; /** * 进度环背景的颜色 */ - 'trail-color': string; + 'trail-color'?: string; /** * 是否显示为仪表盘 */ - dashboard: boolean; + dashboard?: boolean; - $slots: { + 'v-slots'?: { /** * 自定义显示中间内容,内容默认垂直居中 */ - '': []; + default?: () => any; }; -} +}> diff --git a/types/city.d.ts b/types/city.d.ts index 65415a644..ad9fe56e0 100644 --- a/types/city.d.ts +++ b/types/city.d.ts @@ -1,57 +1,59 @@ -export declare class City { +import type { DefineComponent } from 'vue'; + +export declare const City: DefineComponent<{ /** * 指定选中项目的 value 值,可以使用 v-model 双向绑定数据。该值为城市 code,[查看全部城市 code](https://file.iviewui.com/iview-pro/city.json) */ - value: string; + value?: string; /** * value 值可以设置为名称,比如北京(名称不含“市”字) */ - 'use-name': boolean; + 'use-name'?: boolean; /** * 预设城市,会出现在快捷选择区域,各项为城市 code */ - cities: []; + cities?: any[]; /** * 是否禁用选择器 */ - disabled: boolean; + disabled?: boolean; /** * 是否显示后缀“市”,例如开启则显示“北京市”,否则显示“北京” */ - 'show-suffix': boolean; + 'show-suffix'?: boolean; /** * 选择框大小,可选值为`large`、`small`、`default` 或者不填 */ - size: string; + size?: string; /** * 是否将弹层放置于 body 内 */ - transfer: boolean; + transfer?: boolean; /** * 给表单元素设置 `id`,详见 Form 用法。 */ - 'element-id': string; + 'element-id'?: string; /** * 默认的提示文字 */ - placeholder: string; + placeholder?: string; /** * 搜索框默认文字 */ - 'search-placeholder': string; + 'search-placeholder'?: string; /** * 选择城市时触发,返回该城市的详细内容,包括城市 code (c),对应省 code (p),城市名 (n),城市名首字母缩写 (l) */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; -} +}> diff --git a/types/collapse.d.ts b/types/collapse.d.ts index 332ace806..c81eb0c3d 100644 --- a/types/collapse.d.ts +++ b/types/collapse.d.ts @@ -1,47 +1,49 @@ -export declare class Collapse { +import type { DefineComponent } from 'vue'; + +export declare const Collapse: DefineComponent<{ /** * 当前激活的面板的 name,可以使用 v-model 双向绑定 */ - 'model-value': []; + 'model-value'?: any[]; /** * 是否开启手风琴模式,开启后每次至多展开一个面板 */ - accordion: boolean; + accordion?: boolean; /** * 是否开启简洁模式 */ - simple: boolean; + simple?: boolean; /** * 切换面板时触发,返回当前已展开的面板的 key,格式为数组 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; -} +}> -export declare class Panel { +export declare const Panel: DefineComponent<{ /** * 当前面板的 name,与 Collapse的 `value` 对应,不填为索引值 */ - name: string; + name?: string; /** * 隐藏箭头 */ - 'hide-arrow': boolean; + 'hide-arrow'?: boolean; - $slots: { + 'v-slots'?: { /** * 面板头内容 */ - '': []; + default?: () => any; /** * 描述内容 */ - content: []; + content?: () => any; }; -} +}> diff --git a/types/color-picker.d.ts b/types/color-picker.d.ts index 3ce078003..07e3dcdd6 100644 --- a/types/color-picker.d.ts +++ b/types/color-picker.d.ts @@ -1,82 +1,84 @@ -export declare class ColorPicker { +import type { DefineComponent } from 'vue'; + +export declare const ColorPicker: DefineComponent<{ /** * 绑定的值,可使用 v-model 双向绑定 */ - 'model-value': string; + 'model-value'?: string; /** * 是否禁用 */ - disabled: boolean; + disabled?: boolean; /** * 是否可以输入色值 */ - editable: boolean; + editable?: boolean; /** * 是否支持透明度选择 */ - alpha: boolean; + alpha?: boolean; /** * 是否支持色彩选择 */ - hue: boolean; + hue?: boolean; /** * 是否显示推荐的颜色预设 */ - recommend: boolean; + recommend?: boolean; /** * 自定义颜色预设 */ - colors: []; + colors?: any[]; /** * 颜色的格式,可选值为 hsl、hsv、hex、rgb */ - format: 'hsl' | 'hsv' | 'hex' | 'rgb'; + format?: 'hsl' | 'hsv' | 'hex' | 'rgb'; /** * 尺寸,可选值为`large`、`small`、`default`或者不设置 */ - size: '' | 'large' | 'small' | 'default'; + size?: '' | 'large' | 'small' | 'default'; /** * 是否将弹层放置于 body 内,在 Tabs、带有 fixed 的 Table 列内使用时,建议添加此属性,它将不受父级样式影响,从而达到更好的效果 */ - transfer: boolean; + transfer?: boolean; /** * 是否开启 capture 模式,也可通过全局配置 */ - capture: boolean; + capture?: boolean; /** * 开启 transfer 时,给浮层添加额外的 class 名称 */ - 'transfer-class-name': string; + 'transfer-class-name'?: string; /** * 是否开启 Popper 的 eventsEnabled 属性,开启可能会牺牲一定的性能 */ - 'events-enabled': boolean; + 'events-enabled'?: boolean; /** * 当绑定值变化时触发 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; /** * 面板中当前显示的颜色发生改变时触发 */ - $emit(eventName: 'on-active-change'): this; + onOnActiveChange?: (event?: any) => any; /** * 下拉框展开或收起时触发 */ - $emit(eventName: 'on-open-change'): this; + onOnOpenChange?: (event?: any) => any; -} +}> diff --git a/types/count-down.d.ts b/types/count-down.d.ts index 5d81b5b15..b71233685 100644 --- a/types/count-down.d.ts +++ b/types/count-down.d.ts @@ -1,22 +1,24 @@ -export declare class CountDown { +import type { DefineComponent } from 'vue'; + +export declare const CountDown: DefineComponent<{ /** * 目标时间 */ - target: Date | number; + target?: Date | number; /** * 自动倒计时间隔,单位:毫秒 */ - interval: number; + interval?: number; /** * 自定义显示格式 */ - format: Function; + format?: Function; /** * 倒计时结束时触发 */ - $emit(eventName: 'on-end'): this; + onOnEnd?: (event?: any) => any; -} +}> diff --git a/types/count-up.d.ts b/types/count-up.d.ts index 5d3dff80e..deeaf5aff 100644 --- a/types/count-up.d.ts +++ b/types/count-up.d.ts @@ -1,32 +1,34 @@ -export declare class CountUp { +import type { DefineComponent } from 'vue'; + +export declare const CountUp: DefineComponent<{ /** * 起始值 */ - start: number; + start?: number; /** * 结束值,必填 */ - end: number; + end?: number; /** * 小数位数 */ - decimals: number; + decimals?: number; /** * 持续时间,单位:秒 */ - duration: number; + duration?: number; /** * [countup.js](https://github.com/inorganik/countUp.js) 设置项 */ - options: object; + options?: object; /** * 回调函数 */ - callback: Function; + callback?: Function; -} +}> diff --git a/types/date-picker.d.ts b/types/date-picker.d.ts index 397ad1573..d84f37139 100644 --- a/types/date-picker.d.ts +++ b/types/date-picker.d.ts @@ -1,164 +1,166 @@ -export declare class DatePicker { +import type { DefineComponent } from 'vue'; + +export declare const DatePicker: DefineComponent<{ /** * 显示类型,可选值为 `date`、`daterange`、`datetime`、`datetimerange`、`year`、`month` */ - type: 'date' | 'daterange' | 'datetime' | 'datetimerange' | 'year' | 'month'; + type?: 'date' | 'daterange' | 'datetime' | 'datetimerange' | 'year' | 'month'; /** * 日期,可以是 JavaScript 的 Date,例如 **new Date()** ,也可以是标准的日期格式,点击右边查看,注意:model-value 使用 v-model 时,值是 Date 类型,可以配合 @on-change 使用 */ - 'model-value': Date; + 'model-value'?: Date; /** * 展示的日期格式 */ - format: Date; + format?: Date; /** * 日期选择器出现的位置,可选值为`top` `top-start` `top-end` `bottom` `bottom-start` `bottom-end` `left` `left-start` `left-end` `right` `right-start` `right-end` */ - placement: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; + placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; /** * 占位文本 */ - placeholder: string; + placeholder?: string; /** * 选择器额外配置,比如不可选日期与快捷选项,具体项详见下表 */ - options: object; + options?: object; /** * 开启后,左右面板不联动,仅在 `daterange` 和 `datetimerange` 下可用。 */ - 'split-panels': boolean; + 'split-panels'?: boolean; /** * 开启后,可以选择多个日期,仅在 `date` 下可用。 */ - multiple: boolean; + multiple?: boolean; /** * 开启后,可以显示星期数。 */ - 'show-week-numbers': boolean; + 'show-week-numbers'?: boolean; /** * 设置默认显示的起始日期。 */ - 'start-date': Date; + 'start-date'?: Date; /** * 是否显示底部控制栏,开启后,选择完日期,选择器不会主动关闭,需用户确认后才可关闭 */ - confirm: boolean; + confirm?: boolean; /** * 手动控制日期选择器的显示状态,true 为显示,false 为收起。使用该属性后,选择器不会主动关闭。建议配合 slot 及 confirm 和相关事件一起使用 */ - open: boolean; + open?: boolean; /** * 尺寸,可选值为`large`、`small`、`default`或者不设置 */ - size: '' | 'large' | 'small' | 'default'; + size?: '' | 'large' | 'small' | 'default'; /** * 是否禁用选择器 */ - disabled: boolean; + disabled?: boolean; /** * 是否显示清除按钮 */ - clearable: boolean; + clearable?: boolean; /** * 完全只读,开启后不会弹出选择器,只在没有设置 open 属性下生效 */ - readonly: boolean; + readonly?: boolean; /** * 文本框是否可以输入,只在没有使用 slot 时有效 */ - editable: boolean; + editable?: boolean; /** * 是否将弹层放置于 body 内,在 Tabs、带有 fixed 的 Table 列内使用时,建议添加此属性,它将不受父级样式影响,从而达到更好的效果 */ - transfer: boolean; + transfer?: boolean; /** * 给表单元素设置 `id`,详见 Form 用法。 */ - 'element-id': string; + 'element-id'?: string; /** * 可以在 type 为 datetime 和 datetimerange 下,配置 TimePicker 的属性,比如时间间隔 steps:`:time-picker-options="{steps: [1, 10, 10]}"` */ - 'time-picker-options': object; + 'time-picker-options'?: object; /** * 两个日期间的分隔符 */ - separator: string; + separator?: string; /** * 是否开启 capture 模式,也可通过全局配置 */ - capture: boolean; + capture?: boolean; /** * 开启 transfer 时,给浮层添加额外的 class 名称 */ - 'transfer-class-name': string; + 'transfer-class-name'?: string; /** * 是否开启 Popper 的 eventsEnabled 属性,开启可能会牺牲一定的性能 */ - 'events-enabled': boolean; + 'events-enabled'?: boolean; /** * 设置快捷选项,每项内容:**text | String**:显示的文案, **value | Function**:返回指定的日期,如需自己控制逻辑,可不设置,并使用 onClick 回调, **onClick | Function**:点击时的回调,参数为当前日期选择器的 Vue 实例,当需要自定义复杂操作时,可以使用 */ - shortcuts: []; + shortcuts?: any[]; /** * 设置不可选择的日期,参数为当前的日期,需要返回 Boolean 是否禁用这天 */ - disabledDate: Function; + disabledDate?: Function; /** * 日期发生变化时触发 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; /** * 弹出日历和关闭日历时触发 */ - $emit(eventName: 'on-open-change'): this; + onOnOpenChange?: (event?: any) => any; /** * 在 confirm 模式下有效,点击确定按钮时触发 */ - $emit(eventName: 'on-ok'): this; + onOnOk?: (event?: any) => any; /** * 在 confirm 模式或 clearable = true 时有效,在清空日期时触发 */ - $emit(eventName: 'on-clear'): this; + onOnClear?: (event?: any) => any; /** * 点击外部关闭下拉菜单时触发 */ - $emit(eventName: 'on-clickoutside'): this; + onOnClickoutside?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 自定义选择器的显示内容,建议与 open 等参数一起使用,详见示例 */ - '': []; + default?: () => any; }; -} +}> diff --git a/types/description-list.d.ts b/types/description-list.d.ts index 1e9b5217b..900601e76 100644 --- a/types/description-list.d.ts +++ b/types/description-list.d.ts @@ -1,54 +1,56 @@ -export declare class DescriptionList { +import type { DefineComponent } from 'vue'; + +export declare const DescriptionList: DefineComponent<{ /** * 布局方式,可选值为 `horizontal` 或 `vertical` */ - layout: string; + layout?: string; /** * 列表标题 */ - title: string; + title?: string; /** * 列表项间距,单位为 `px` */ - gutter: number; + gutter?: number; /** * 指定信息最多分几列展示,最终一行几列由 col 配置结合响应式规则(见下表)决定,可选值为 `1`、`2`、`3`、`4` */ - col: number; + col?: number; - $slots: { + 'v-slots'?: { /** * 自定义列标题 */ - title: []; + title?: () => any; /** * 默认 */ - default: []; + default?: () => any; }; -} +}> -export declare class Description { +export declare const Description: DefineComponent<{ /** * 列表项标题 */ - term: string; + term?: string; - $slots: { + 'v-slots'?: { /** * 自定义列表项标题 */ - term: []; + term?: () => any; /** * 默认 */ - default: []; + default?: () => any; }; -} +}> diff --git a/types/divider.d.ts b/types/divider.d.ts index a867a4982..216d0741d 100644 --- a/types/divider.d.ts +++ b/types/divider.d.ts @@ -1,27 +1,29 @@ -export declare class Divider { +import type { DefineComponent } from 'vue'; + +export declare const Divider: DefineComponent<{ /** * 水平还是垂直类型,可选值为 horizontal 或 vertical */ - type: 'horizontal' | 'vertical'; + type?: 'horizontal' | 'vertical'; /** * 分割线标题的位置,可选值为 left、right 或 center */ - orientation: 'left' | 'right' | 'center'; + orientation?: 'left' | 'right' | 'center'; /** * 是否虚线 */ - dashed: boolean; + dashed?: boolean; /** * 文字是否显示为普通正文样式 */ - plain: boolean; + plain?: boolean; /** * 尺寸,可选值为 small 或 default */ - size: string; + size?: string; -} +}> diff --git a/types/drawer.d.ts b/types/drawer.d.ts index 27ebb2ee0..4edf126bd 100644 --- a/types/drawer.d.ts +++ b/types/drawer.d.ts @@ -1,129 +1,131 @@ -export declare class Drawer { +import type { DefineComponent } from 'vue'; + +export declare const Drawer: DefineComponent<{ /** * 抽屉是否显示,可使用 v-model 双向绑定数据 */ - 'model-value': boolean; + 'model-value'?: boolean; /** * 抽屉标题,如果使用 slot 自定义了页头,则 title 无效 */ - title: string; + title?: string; /** * 抽屉宽度,左、右方向时可用。当其值不大于 100 时以百分比显示,大于 100 时为像素 */ - width: number | string; + width?: number | string; /** * 抽屉高度,上、下方向时可用。当其值不大于 100 时以百分比显示,大于 100 时为像素 */ - height: number | string; + height?: number | string; /** * 是否显示右上角的关闭按钮 */ - closable: boolean; + closable?: boolean; /** * 是否允许点击遮罩层关闭 */ - 'mask-closable': boolean; + 'mask-closable'?: boolean; /** * 是否显示遮罩层 */ - mask: boolean; + mask?: boolean; /** * 遮罩层样式 */ - 'mask-style': object; + 'mask-style'?: object; /** * 抽屉中间层的样式 */ - styles: object; + styles?: object; /** * 页面是否可以滚动 */ - scrollable: boolean; + scrollable?: boolean; /** * 抽屉的方向,可选值为 left、right、top、bottom */ - placement: 'left' | 'right' | 'top' | 'bottom'; + placement?: 'left' | 'right' | 'top' | 'bottom'; /** * 设置 Drawer 的 z-index */ - 'z-index': number; + 'z-index'?: number; /** * 是否将抽屉放置于 body 内 */ - transfer: boolean; + transfer?: boolean; /** * 设置抽屉容器.ivu-drawer-wrap的类名 */ - 'class-name': string; + 'class-name'?: string; /** * 是否设置抽屉在某个元素内打开,开启此属性时,应当关闭 transfer 属性 */ - inner: boolean; + inner?: boolean; /** * 是否开启拖拽调整宽度 */ - draggable: boolean; + draggable?: boolean; /** * 返回 Promise 可以阻止关闭 */ - 'before-close': Function; + 'before-close'?: Function; /** * 是否禁止对页面滚动条的修改 */ - 'lock-scroll': boolean; + 'lock-scroll'?: boolean; /** * 关闭抽屉时触发 */ - $emit(eventName: 'on-close'): this; + onOnClose?: (event?: any) => any; /** * 显示状态发生变化时触发 */ - $emit(eventName: 'on-visible-change'): this; + onOnVisibleChange?: (event?: any) => any; /** * 调整宽度时触发 */ - $emit(eventName: 'on-resize-width'): this; + onOnResizeWidth?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 自定义标题栏 */ - header: []; + header?: () => any; /** * 自定义右上角关闭内容 */ - close: []; + close?: () => any; /** * 自定义调整宽度节点 */ - trigger: []; + trigger?: () => any; /** * 抽屉主体内容 */ - '': []; + default?: () => any; }; -} +}> diff --git a/types/dropdown.d.ts b/types/dropdown.d.ts index 36e403a35..44d962327 100644 --- a/types/dropdown.d.ts +++ b/types/dropdown.d.ts @@ -1,102 +1,104 @@ -export declare class Dropdown { +import type { DefineComponent } from 'vue'; + +export declare const Dropdown: DefineComponent<{ /** * 触发方式,可选值为 `hover`(悬停)`click`(点击)`contextMenu`(右键)`custom`(自定义),使用 custom 时,需配合 visible 一起使用 */ - trigger: 'hover' | 'click' | 'custom' | 'contextMenu'; + trigger?: 'hover' | 'click' | 'custom' | 'contextMenu'; /** * 手动控制下拉框的显示,在 trigger = 'custom' 时使用 */ - visible: boolean; + visible?: boolean; /** * 下拉菜单出现的位置,可选值为`top`、`top-start`、`top-end`、`bottom`、`bottom-start`、`bottom-end`、`left`、`left-start`、`left-end`、`right`、`right-start`、`right-end` */ - placement: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; + placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; /** * 是否将弹层放置于 body 内,在 Tabs、带有 fixed 的 Table 列内使用时,建议添加此属性,它将不受父级样式影响,从而达到更好的效果 */ - transfer: boolean; + transfer?: boolean; /** * 开启 transfer 时,给浮层添加额外的 class 名称 */ - 'transfer-class-name': string; + 'transfer-class-name'?: string; /** * 是否开启 stop-propagation */ - 'stop-propagation': boolean; + 'stop-propagation'?: boolean; /** * 是否开启 Popper 的 eventsEnabled 属性,开启可能会牺牲一定的性能 */ - 'events-enabled': boolean; + 'events-enabled'?: boolean; /** * 设置 Popper 的 boundaries-element,比如 viewport */ - 'boundaries-element': string | HTMLElement; + 'boundaries-element'?: string | HTMLElement; /** * 点击菜单项时触发 */ - $emit(eventName: 'on-click'): this; + onOnClick?: (event?: any) => any; /** * 菜单显示状态改变时调用 */ - $emit(eventName: 'on-visible-change'): this; + onOnVisibleChange?: (event?: any) => any; /** * 点击外部关闭下拉菜单时触发 */ - $emit(eventName: 'on-clickoutside'): this; + onOnClickoutside?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 主体内容 */ - '': []; + default?: () => any; /** * 列表内容,一般由 `DropdownMenu` 承担 */ - list: []; + list?: () => any; }; -} +}> -export declare class DropdownItem { +export declare const DropdownItem: DefineComponent<{ /** * 用来标识这一项 */ - name: string; + name?: string; /** * 禁用该项 */ - disabled: boolean; + disabled?: boolean; /** * 显示分割线 */ - divided: boolean; + divided?: boolean; /** * 标记该项为选中状态 */ - selected: boolean; + selected?: boolean; -} +}> -export declare class DropdownMenu { - $slots: { +export declare const DropdownMenu: DefineComponent<{ + 'v-slots'?: { /** * 默认插槽内容 */ - default: []; + default?: () => any; }; -} +}> diff --git a/types/ellipsis.d.ts b/types/ellipsis.d.ts index 588e17fcd..4abfce043 100644 --- a/types/ellipsis.d.ts +++ b/types/ellipsis.d.ts @@ -1,67 +1,69 @@ -export declare class Ellipsis { +import type { DefineComponent } from 'vue'; + +export declare const Ellipsis: DefineComponent<{ /** * 文本 */ - text: string; + text?: string; /** * 限制的高度 */ - height: number; + height?: number; /** * 限制行数,将换算为 height。如果设置了 height,则直接使用 height 计算 */ - lines: number; + lines?: number; /** * 按照指定长度截取 */ - length: number; + length?: number; /** * 是否将全角字符的长度视为2来计算字符串长度,适用于 length */ - 'full-width-recognition': boolean; + 'full-width-recognition'?: boolean; /** * 是否禁用 */ - disabled: boolean; + disabled?: boolean; /** * 是否开启 tooltip */ - tooltip: boolean; + tooltip?: boolean; /** * tooltip 的 transfer 属性 */ - transfer: boolean; + transfer?: boolean; /** * tooltip 的 theme 属性,可选值为 light 或 dark */ - theme: string; + theme?: string; /** * tooltip 的 max-width 属性 */ - 'max-width': string | number; + 'max-width'?: string | number; /** * tooltip 的 placement 属性 */ - placement: string; + placement?: string; /** * 文本全部展示的时候触发 */ - $emit(eventName: 'on-show'): this; + onOnShow?: (event?: any) => any; /** * 文本省略的时候触发 */ - $emit(eventName: 'on-hide'): this; + onOnHide?: (event?: any) => any; -} +}> diff --git a/types/exception.d.ts b/types/exception.d.ts index 5a4d45aac..6861ff764 100644 --- a/types/exception.d.ts +++ b/types/exception.d.ts @@ -1,54 +1,56 @@ -export declare class Exception { +import type { DefineComponent } from 'vue'; + +export declare const Exception: DefineComponent<{ /** * 页面类型,可选值为 404、403、500 */ - type: '404' | '403' | '500' | 404 | 403 | 500; + type?: '404' | '403' | '500' | 404 | 403 | 500; /** * 标题,不填写会自动根据 type 获取 */ - title: string; + title?: string; /** * 补充描述,不填写会自动根据 type 获取 */ - desc: string; + desc?: string; /** * 背景图片地址,不填写会自动根据 type 获取 */ - img: string; + img?: string; /** * 是否显示彩色的背景图片,设置 img 时无效 */ - 'img-color': boolean; + 'img-color'?: boolean; /** * 默认的返回按钮文本 */ - 'back-text': string; + 'back-text'?: string; /** * 返回按钮的跳转地址 */ - redirect: string; + redirect?: string; - $slots: { + 'v-slots'?: { /** * 自定义标题 */ - title: []; + title?: () => any; /** * 自定义补充描述 */ - desc: []; + desc?: () => any; /** * 自定义操作区 */ - actions: []; + actions?: () => any; }; -} +}> diff --git a/types/footer-toolbar.d.ts b/types/footer-toolbar.d.ts index 319ad05c1..8e2c8f1b5 100644 --- a/types/footer-toolbar.d.ts +++ b/types/footer-toolbar.d.ts @@ -1,7 +1,9 @@ -export declare class FooterToolbar { +import type { DefineComponent } from 'vue'; + +export declare const FooterToolbar: DefineComponent<{ /** * 额外信息,向左对齐 */ - extra: string; + extra?: string; -} +}> diff --git a/types/form.d.ts b/types/form.d.ts index e7f50b9de..7483c10cb 100644 --- a/types/form.d.ts +++ b/types/form.d.ts @@ -1,112 +1,114 @@ -export declare class Form { +import type { DefineComponent } from 'vue'; + +export declare const Form: DefineComponent<{ /** * 表单数据对象 */ - model: object; + model?: object; /** * 表单验证规则,具体配置查看 [async-validator](https://github.com/yiminghe/async-validator) */ - rules: object; + rules?: object; /** * 是否开启行内表单模式 */ - inline: boolean; + inline?: boolean; /** * 表单域标签的位置,可选值为 `left`、`right`、`top` */ - 'label-position': 'left' | 'right' | 'top'; + 'label-position'?: 'left' | 'right' | 'top'; /** * 表单域标签的宽度,所有的 FormItem 都会继承 Form 组件的 label-width 的值 */ - 'label-width': number; + 'label-width'?: number; /** * 是否显示校验错误信息 */ - 'show-message': boolean; + 'show-message'?: boolean; /** * 原生的 autocomplete 属性,可选值为 off 或 on */ - autocomplete: string; + autocomplete?: string; /** * 是否隐藏所有表单项的必选标记 */ - 'hide-required-mark': boolean; + 'hide-required-mark'?: boolean; /** * 是否自动在 label 名称后添加冒号 */ - 'label-colon': boolean; + 'label-colon'?: boolean; /** * 是否禁用该表单内的所有组件(适用于具有 disabled 属性的表单类组件) */ - disabled: boolean; + disabled?: boolean; /** * 任一表单项被校验后触发,返回表单项 prop、校验状态、错误消息 */ - $emit(eventName: 'on-validate'): this; + onOnValidate?: (event?: any) => any; -} +}> -export declare class FormItem { +export declare const FormItem: DefineComponent<{ /** * 对应表单域 model 里的字段 */ - prop: string; + prop?: string; /** * 标签文本 */ - label: string; + label?: string; /** * 表单域标签的的宽度 */ - 'label-width': number; + 'label-width'?: number; /** * 指定原生的 label 标签的 for 属性,配合控件的 `element-id` 属性,可以点击 label 时聚焦控件。 */ - 'label-for': string; + 'label-for'?: string; /** * 是否必填,如不设置,则会根据校验规则自动生成 */ - required: boolean; + required?: boolean; /** * 表单验证规则 */ - rules: object | []; + rules?: object | any[]; /** * 表单域验证错误信息, 设置该值会使表单验证状态变为error,并显示该错误信息 */ - error: string; + error?: string; /** * 是否显示校验错误信息 */ - 'show-message': boolean; + 'show-message'?: boolean; - $slots: { + 'v-slots'?: { /** * 内容 */ - '': []; + default?: () => any; /** * label 内容 */ - label: []; + label?: () => any; }; -} +}> diff --git a/types/global-footer.d.ts b/types/global-footer.d.ts index a22a38c78..249c6d64a 100644 --- a/types/global-footer.d.ts +++ b/types/global-footer.d.ts @@ -1,57 +1,59 @@ -export declare class GlobalFooter { +import type { DefineComponent } from 'vue'; + +export declare const GlobalFooter: DefineComponent<{ /** * 链接数据,各项内容见下表 */ - links: []; + links?: any[]; /** * 版权信息 */ - copyright: string; + copyright?: string; - $slots: { + 'v-slots'?: { /** * 自定义链接区域 */ - links: []; + links?: () => any; /** * 自定义版权内容 */ - copyright: []; + copyright?: () => any; }; -} +}> -export declare class Links { +export declare const Links: DefineComponent<{ /** * 链接地址 */ - href: string; + href?: string; /** * 是否新窗口打开 */ - 'blank-target': boolean; + 'blank-target'?: boolean; /** * 指定 key */ - key: string; + key?: string; /** * 内容 */ - title: string; + title?: string; /** * 图标 type */ - icon: string; + icon?: string; /** * 自定义图标 */ - 'custom-icon': string; + 'custom-icon'?: string; -} +}> diff --git a/types/grid.d.ts b/types/grid.d.ts index b2046b595..ad6278a1b 100644 --- a/types/grid.d.ts +++ b/types/grid.d.ts @@ -1,42 +1,44 @@ -export declare class Grid { +import type { DefineComponent } from 'vue'; + +export declare const Grid: DefineComponent<{ /** * 最大支持的列数 */ - col: number; + col?: number; /** * 是否宽高一致 */ - square: boolean; + square?: boolean; /** * 内容的间距 */ - padding: string; + padding?: string; /** * 内容是否垂直居中,GridItem 需有高度 */ - center: boolean; + center?: boolean; /** * 是否显示边框 */ - border: boolean; + border?: boolean; /** * 是否开启鼠标悬停效果 */ - hover: boolean; + hover?: boolean; -} +}> -export declare class GridItem { - $slots: { +export declare const GridItem: DefineComponent<{ + 'v-slots'?: { /** * 默认插槽内容 */ - default: []; + default?: () => any; }; -} +}> diff --git a/types/icon.d.ts b/types/icon.d.ts index fb19f31f6..8bb1c5493 100644 --- a/types/icon.d.ts +++ b/types/icon.d.ts @@ -1,22 +1,24 @@ -export declare class Icon { +import type { DefineComponent } from 'vue'; + +export declare const Icon: DefineComponent<{ /** * 图标的名称 */ - type: string; + type?: string; /** * 图标的大小,单位是 px */ - size: number | string; + size?: number | string; /** * 图标的颜色 */ - color: string; + color?: string; /** * 自定义图标 */ - custom: string; + custom?: string; -} +}> diff --git a/types/image.d.ts b/types/image.d.ts index 54322694f..c81ce0653 100644 --- a/types/image.d.ts +++ b/types/image.d.ts @@ -1,172 +1,174 @@ -export declare class Image { +import type { DefineComponent } from 'vue'; + +export declare const Image: DefineComponent<{ /** * 图片地址 */ - src: string; + src?: string; /** * 图片描述 */ - alt: string; + alt?: string; /** * 原生属性 */ - 'referrer-policy': string; + 'referrer-policy'?: string; /** * 宽度 */ - width: string | number; + width?: string | number; /** * 高度 */ - height: string | number; + height?: string | number; /** * 图片适配容器模式包含:`fill`,`contain`,`cover`,`none`,`scale-down` */ - fit: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down'; + fit?: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down'; /** * 是否懒加载 */ - lazy: boolean; + lazy?: boolean; /** * 加载容器 */ - 'scroll-container': string | HTMLElement; + 'scroll-container'?: string | HTMLElement; /** * 是否将弹层放置于 body 内 */ - transfer: boolean; + transfer?: boolean; /** * 是否允许点击遮罩层关闭 */ - 'mask-closable': boolean; + 'mask-closable'?: boolean; /** * 是否显示预览提示和遮罩 */ - 'preview-tip': boolean; + 'preview-tip'?: boolean; /** * 是否图片预览 */ - preview: boolean; + preview?: boolean; /** * 图片预览列表 */ - 'preview-list': []; + 'preview-list'?: any[]; /** * 是否循环切换 */ - infinite: boolean; + infinite?: boolean; /** * 打开预览的第一项 */ - 'initial-index': number; + 'initial-index'?: number; /** * 图片预览操作栏选项,按数组顺序排序 */ - toolbar: []; + toolbar?: any[]; /** * 图片加载成功 */ - $emit(eventName: 'on-load'): this; + onOnLoad?: (event?: any) => any; /** * 图片加载失败 */ - $emit(eventName: 'on-error'): this; + onOnError?: (event?: any) => any; /** * 图片预览切换 */ - $emit(eventName: 'on-switch'): this; + onOnSwitch?: (event?: any) => any; /** * 图片预览关闭 */ - $emit(eventName: 'on-close'): this; + onOnClose?: (event?: any) => any; /** * 图片点击 */ - $emit(eventName: 'on-click'): this; + onOnClick?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 自定义图片加载中 */ - placeholder: []; + placeholder?: () => any; /** * 自定义图片加载失败 */ - error: []; + error?: () => any; /** * 自定义图片预览 */ - preview: []; + preview?: () => any; }; -} +}> -export declare class ImagePreview { +export declare const ImagePreview: DefineComponent<{ /** * 是否显示,可使用 v-model 双向绑定 */ - 'model-value': boolean; + 'model-value'?: boolean; /** * 图片预览列表 */ - 'preview-list': []; + 'preview-list'?: any[]; /** * 打开预览的第一项 */ - 'initial-index': number; + 'initial-index'?: number; /** * 是否循环切换 */ - infinite: boolean; + infinite?: boolean; /** * 是否允许点击遮罩层关闭 */ - 'mask-closable': boolean; + 'mask-closable'?: boolean; /** * 是否将弹层放置于 body 内 */ - transfer: boolean; + transfer?: boolean; /** * 操作栏选项,按数组顺序排序 */ - toolbar: []; + toolbar?: any[]; /** * 图片预览切换 */ - $emit(eventName: 'on-switch'): this; + onOnSwitch?: (event?: any) => any; /** * 图片预览关闭 */ - $emit(eventName: 'on-close'): this; + onOnClose?: (event?: any) => any; -} +}> diff --git a/types/index.d.ts b/types/index.d.ts index d8dd95b98..6da4b3324 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -5,27 +5,27 @@ export * from './viewuiplus.components'; interface ViewUIPlusGlobalOptions { size?: string; transfer?: boolean | string; - select: { + select?: { arrow: string; customArrow: string; arrowSize: number | string; }; - cell: { + cell?: { arrow: string; customArrow: string; arrowSize: number | string; }; - menu: { + menu?: { arrow: string; customArrow: string; arrowSize: number | string; }; - tree: { + tree?: { arrow: string; customArrow: string; arrowSize: number | string; }; - cascader: { + cascader?: { arrow: string; customArrow: string; arrowSize: number | string; @@ -33,39 +33,39 @@ interface ViewUIPlusGlobalOptions { customItemArrow: string; itemArrowSize: number | string; }; - colorPicker: { + colorPicker?: { arrow: string; customArrow: string; arrowSize: number | string; }; - datePicker: { + datePicker?: { icon: string; customIcon: string; iconSize: number | string; }; - timePicker: { + timePicker?: { icon: string; customIcon: string; iconSize: number | string; }; - tabs: { + tabs?: { closeIcon: string; customCloseIcon: string; closeIconSize: number | string; }; - modal: { + modal?: { maskClosable: boolean | string; }; - typography: { + typography?: { copyConfig: object; editConfig: object; ellipsisConfig: object; }; - space: { - size: string | number | []; + space?: { + size: string | number | any[]; }; - image: { - toolbar: []; + image?: { + toolbar: any[]; }; } @@ -77,6 +77,16 @@ interface ViewUIPlusInstallOptions extends ViewUIPlusGlobalOptions{ declare module '@vue/runtime-core' { interface ComponentCustomProperties { $VIEWUI: ViewUIPlusGlobalOptions; + $Spin: any; + $Loading: any; + $Message: any; + $Notice: any; + $Modal: any; + $ImagePreview: any; + $Copy: any; + $ScrollIntoView: any; + $ScrollTop: any; + $Date: any; } } diff --git a/types/input-number.d.ts b/types/input-number.d.ts index 6d97cd6df..de8e71dc7 100644 --- a/types/input-number.d.ts +++ b/types/input-number.d.ts @@ -1,92 +1,94 @@ -export declare class InputNumber { +import type { DefineComponent } from 'vue'; + +export declare const InputNumber: DefineComponent<{ /** * 最大值 */ - max: number; + max?: number; /** * 最小值 */ - min: number; + min?: number; /** * 当前值,可以使用 v-model 双向绑定数据 */ - 'model-value': number; + 'model-value'?: number; /** * 按钮位置是否置于两侧 */ - 'controls-outside': boolean; + 'controls-outside'?: boolean; /** * 每次改变的步伐,可以是小数 */ - step: number; + step?: number; /** * 输入框尺寸,可选值为`large`、`small`、`default`或者不填 */ - size: '' | 'large' | 'small' | 'default'; + size?: '' | 'large' | 'small' | 'default'; /** * 设置禁用状态 */ - disabled: boolean; + disabled?: boolean; /** * 占位文本 */ - placeholder: string; + placeholder?: string; /** * 指定输入框展示值的格式 */ - formatter: Function; + formatter?: Function; /** * 指定从 formatter 里转换回数字的方式,和 formatter 搭配使用 */ - parser: Function; + parser?: Function; /** * 是否设置为只读 */ - readonly: boolean; + readonly?: boolean; /** * 是否可编辑 */ - editable: boolean; + editable?: boolean; /** * 数值精度 */ - precision: number; + precision?: number; /** * 给表单元素设置 `id`,详见 Form 用法。 */ - 'element-id': string; + 'element-id'?: string; /** * 是否实时响应数据,设置为 false 时,只会在失焦时更改数据 */ - 'active-change': boolean; + 'active-change'?: boolean; /** * 数值改变时的回调,返回当前值 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; /** * 聚焦时触发 */ - $emit(eventName: 'on-focus'): this; + onOnFocus?: (event?: any) => any; /** * 失焦时触发 */ - $emit(eventName: 'on-blur'): this; + onOnBlur?: (event?: any) => any; -} +}> diff --git a/types/input.d.ts b/types/input.d.ts index 1982efd66..91613b350 100644 --- a/types/input.d.ts +++ b/types/input.d.ts @@ -1,194 +1,196 @@ -export declare class Input { +import type { DefineComponent } from 'vue'; + +export declare const Input: DefineComponent<{ /** * 输入框类型,可选值为 `text`、`password`、`textarea`、`url`、`email`、`date`、`number`、`tel` */ - type: 'text' | 'password' | 'textarea' | 'url' | 'email' | 'date' | 'number' | 'tel'; + type?: 'text' | 'password' | 'textarea' | 'url' | 'email' | 'date' | 'number' | 'tel'; /** * 绑定的值,可使用 v-model 双向绑定 */ - 'model-value': string | number; + 'model-value'?: string | number; /** * 输入框尺寸,可选值为`large`、`small`、`default`或者不设置 */ - size: '' | 'large' | 'small' | 'default'; + size?: '' | 'large' | 'small' | 'default'; /** * 占位文本 */ - placeholder: string; + placeholder?: string; /** * 是否显示清空按钮 */ - clearable: boolean; + clearable?: boolean; /** * 是否显示边框 */ - border: boolean; + border?: boolean; /** * 设置输入框为禁用状态 */ - disabled: boolean; + disabled?: boolean; /** * 设置输入框为只读 */ - readonly: boolean; + readonly?: boolean; /** * 最大输入长度 */ - maxlength: number; + maxlength?: number; /** * 是否显示输入字数统计,可以配合 maxlength 使用 */ - 'show-word-limit': boolean; + 'show-word-limit'?: boolean; /** * 是否显示切换密码图标 */ - password: boolean; + password?: boolean; /** * 输入框尾部图标,仅在 text 类型下有效 */ - icon: string; + icon?: string; /** * 输入框头部图标 */ - prefix: string; + prefix?: string; /** * 输入框尾部图标 */ - suffix: string; + suffix?: string; /** * 是否显示为搜索型输入框 */ - search: boolean; + search?: boolean; /** * 开启 search 时可用,是否有确认按钮,可设为按钮文字 */ - 'enter-button': boolean | string; + 'enter-button'?: boolean | string; /** * 文本域默认行数,仅在 textarea 类型下有效 */ - rows: number; + rows?: number; /** * 自适应内容高度,仅在 textarea 类型下有效,可传入对象,如 { minRows: 2, maxRows: 6 } */ - autosize: boolean | object; + autosize?: boolean | object; /** * 将用户的输入转换为 Number 类型 */ - number: boolean; + number?: boolean; /** * 自动获取焦点 */ - autofocus: boolean; + autofocus?: boolean; /** * 原生的自动完成功能 */ - autocomplete: string; + autocomplete?: string; /** * 给表单元素设置 `id`,详见 Form 用法。 */ - 'element-id': string; + 'element-id'?: string; /** * 原生的 spellcheck 属性 */ - spellcheck: boolean; + spellcheck?: boolean; /** * 原生的 wrap 属性,可选值为 hard 和 soft,仅在 textarea 下生效 */ - wrap: 'hard' | 'soft'; + wrap?: 'hard' | 'soft'; /** * 按下回车键时触发 */ - $emit(eventName: 'on-enter'): this; + onOnEnter?: (event?: any) => any; /** * 设置 icon 属性后,点击图标时触发 */ - $emit(eventName: 'on-click'): this; + onOnClick?: (event?: any) => any; /** * 数据改变时触发 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; /** * 输入框聚焦时触发 */ - $emit(eventName: 'on-focus'): this; + onOnFocus?: (event?: any) => any; /** * 输入框失去焦点时触发 */ - $emit(eventName: 'on-blur'): this; + onOnBlur?: (event?: any) => any; /** * 原生的 keyup 事件 */ - $emit(eventName: 'on-keyup'): this; + onOnKeyup?: (event?: any) => any; /** * 原生的 keydown 事件 */ - $emit(eventName: 'on-keydown'): this; + onOnKeydown?: (event?: any) => any; /** * 原生的 keypress 事件 */ - $emit(eventName: 'on-keypress'): this; + onOnKeypress?: (event?: any) => any; /** * 开启 search 时可用,点击搜索或按下回车键时触发 */ - $emit(eventName: 'on-search'): this; + onOnSearch?: (event?: any) => any; /** * 开启 clearable 时可用,点击清空按钮时触发 */ - $emit(eventName: 'on-clear'): this; + onOnClear?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 前置内容,仅在 text 类型下有效 */ - prepend: []; + prepend?: () => any; /** * 后置内容,仅在 text 类型下有效 */ - append: []; + append?: () => any; /** * 输入框头部图标 */ - prefix: []; + prefix?: () => any; /** * 输入框尾部图标 */ - suffix: []; + suffix?: () => any; }; -} +}> diff --git a/types/layout.d.ts b/types/layout.d.ts index 15a4fe036..0b8f9ecfc 100644 --- a/types/layout.d.ts +++ b/types/layout.d.ts @@ -1,94 +1,96 @@ -export declare class Sider { +import type { DefineComponent } from 'vue'; + +export declare const Sider: DefineComponent<{ /** * 是否收起, 可以使用 v-model来进行双向绑定 */ - 'model-value': boolean; + 'model-value'?: boolean; /** * 触发响应式布局的断点,可选值为`xs`,`sm`,`md`,`lg`,`xl`或`xxl`,若不设此属性则不会触发响应式布局。 */ - breakpoint: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'; + breakpoint?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'; /** * 宽度 */ - width: number; + width?: number; /** * 是否可收起,设为`false`后,默认触发器会隐藏,且响应式布局不会触发 */ - collapsible: boolean; + collapsible?: boolean; /** * 收缩宽度,设置为 0 会出现特殊 trigger */ - 'collapsed-width': number; + 'collapsed-width'?: number; /** * 隐藏默认触发器 */ - 'hide-trigger': boolean; + 'hide-trigger'?: boolean; /** * 是否默认收起,设置了`collapsible`后设置此属性侧边栏仍会收起。 */ - 'default-collapsed': boolean; + 'default-collapsed'?: boolean; /** * 改变侧边栏触发器箭头方向,和改变侧边栏收起方向,当Sider在右边时可以使用。 */ - 'reverse-arrow': boolean; + 'reverse-arrow'?: boolean; /** * 展开-收起时的回调 */ - $emit(eventName: 'on-collapse'): this; + onOnCollapse?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 自定义触发器 */ - trigger: []; + trigger?: () => any; }; -} +}> -export declare class Layout { - $slots: { +export declare const Layout: DefineComponent<{ + 'v-slots'?: { /** * 默认插槽内容 */ - default: []; + default?: () => any; }; -} +}> -export declare class Content { - $slots: { +export declare const Content: DefineComponent<{ + 'v-slots'?: { /** * 默认插槽内容 */ - default: []; + default?: () => any; }; -} +}> -export declare class Footer { - $slots: { +export declare const Footer: DefineComponent<{ + 'v-slots'?: { /** * 默认插槽内容 */ - default: []; + default?: () => any; }; -} +}> -export declare class Header { - $slots: { +export declare const Header: DefineComponent<{ + 'v-slots'?: { /** * 默认插槽内容 */ - default: []; + default?: () => any; }; -} +}> diff --git a/types/list.d.ts b/types/list.d.ts index 8a9d149cc..77a18861e 100644 --- a/types/list.d.ts +++ b/types/list.d.ts @@ -1,104 +1,106 @@ -export declare class List { +import type { DefineComponent } from 'vue'; + +export declare const List: DefineComponent<{ /** * 是否显示边框 */ - border: boolean; + border?: boolean; /** * 设置 ListItem 布局, 可选值为 horizontal(横排)或 vertical(竖直) */ - 'item-layout': string; + 'item-layout'?: string; /** * 列表头部 */ - header: string; + header?: string; /** * 列表底部 */ - footer: string; + footer?: string; /** * 列表是否正在加载 */ - loading: boolean; + loading?: boolean; /** * 列表尺寸,可选值为 small、large、default */ - size: string; + size?: string; /** * 是否展示分割线 */ - split: boolean; + split?: boolean; - $slots: { + 'v-slots'?: { /** * 自定义列表头部 */ - header: []; + header?: () => any; /** * 自定义列表底部 */ - footer: []; + footer?: () => any; /** * 自定义加载中 */ - loading: []; + loading?: () => any; }; -} +}> -export declare class ListItemMeta { +export declare const ListItemMeta: DefineComponent<{ /** * 列表元素的图标 */ - avatar: string; + avatar?: string; /** * 列表元素的标题 */ - title: string; + title?: string; /** * 列表元素的描述内容 */ - description: string; + description?: string; - $slots: { + 'v-slots'?: { /** * 自定义列表元素的图标 */ - avatar: []; + avatar?: () => any; /** * 自定义列表元素的标题 */ - title: []; + title?: () => any; /** * 自定义列表元素的描述内容 */ - description: []; + description?: () => any; }; -} +}> -export declare class ListItem { - $slots: { +export declare const ListItem: DefineComponent<{ + 'v-slots'?: { /** * 列表操作组,根据 item-layout 的不同, 位置在卡片底部或者最右侧 */ - action: []; + action?: () => any; /** * 额外内容, 通常用在 item-layout 为 vertical 的情况下, 展示右侧内容; horizontal 展示在列表元素最右侧 */ - extra: []; + extra?: () => any; }; -} +}> diff --git a/types/loading-bar.d.ts b/types/loading-bar.d.ts index 2abf21064..c8ca44c3a 100644 --- a/types/loading-bar.d.ts +++ b/types/loading-bar.d.ts @@ -1,4 +1,6 @@ -export declare class LoadingBar { +import type { DefineComponent } from 'vue'; + +export declare const LoadingBar: DefineComponent<{ /** * 开始从 0 显示进度条,并自动加载进度 */ @@ -19,27 +21,27 @@ export declare class LoadingBar { */ update(percent?: number): void; -} +}> -export declare class LoadingBarConfig { +export declare const LoadingBarConfig: { /** * 进度条的颜色,默认为 View UI Plus 主色 */ - color: string; + color?: string; /** * 失败时的进度条颜色,默认为 View UI Plus 主色 */ - failedColor: string; + failedColor?: string; /** * 进度条高度,单位 px */ - height: number; + height?: number; /** * 隐藏时的持续时间,单位 ms */ - duration: number; + duration?: number; } diff --git a/types/login.d.ts b/types/login.d.ts index d9699f365..62d9a229a 100644 --- a/types/login.d.ts +++ b/types/login.d.ts @@ -1,162 +1,164 @@ -export declare class UserName { +import type { DefineComponent } from 'vue'; + +export declare const UserName: DefineComponent<{ /** * 默认值,设置后,初始化时会显示,`不能`使用 v-model */ - value: string; + value?: string; /** * 自定义校验字段,`必填` */ - name: string; + name?: string; /** * 校验规则,同 Form */ - rules: object | []; + rules?: object | any[]; /** * 是否在按下回车时提交 */ - 'enter-to-submit': boolean; + 'enter-to-submit'?: boolean; /** * 数据改变时触发 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; -} +}> -export declare class Captcha { +export declare const Captcha: DefineComponent<{ /** * 设置后,需要对应 name 的表单验证过才会触发 */ - field: string | []; + field?: string | any[]; /** * 倒计时时间,单位:秒,如果设置为 0,则不置为 disabled */ - 'count-down': number; + 'count-down'?: number; /** * 按钮文案,也支持同名 slot,且 slot 优先 */ - text: string; + text?: string; /** * 倒计时单位 */ - 'unit-text': string; + 'unit-text'?: string; /** * 返回 Promise 可以阻止点击 */ - 'before-click': Function; + 'before-click'?: Function; /** * 点击获取验证码时触发。 */ - $emit(eventName: 'on-get-captcha'): this; + onOnGetCaptcha?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 自定义按钮文案,比如是图片验证码,可做到点击切换验证码 */ - text: []; + text?: () => any; }; -} +}> -export declare class Password { +export declare const Password: DefineComponent<{ /** * 默认值,设置后,初始化时会显示,`不能`使用 v-model */ - value: string; + value?: string; /** * 自定义校验字段,`必填` */ - name: string; + name?: string; /** * 校验规则,同 Form */ - rules: object | []; + rules?: object | any[]; /** * 是否在按下回车时提交 */ - 'enter-to-submit': boolean; + 'enter-to-submit'?: boolean; /** * 数据改变时触发 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; -} +}> -export declare class Email { +export declare const Email: DefineComponent<{ /** * 默认值,设置后,初始化时会显示,`不能`使用 v-model */ - value: string; + value?: string; /** * 自定义校验字段,`必填` */ - name: string; + name?: string; /** * 校验规则,同 Form */ - rules: object | []; + rules?: object | any[]; /** * 是否在按下回车时提交 */ - 'enter-to-submit': boolean; + 'enter-to-submit'?: boolean; /** * 数据改变时触发 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; -} +}> -export declare class Mobile { +export declare const Mobile: DefineComponent<{ /** * 默认值,设置后,初始化时会显示,`不能`使用 v-model */ - value: string; + value?: string; /** * 自定义校验字段,`必填` */ - name: string; + name?: string; /** * 校验规则,同 Form */ - rules: object | []; + rules?: object | any[]; /** * 是否在按下回车时提交 */ - 'enter-to-submit': boolean; + 'enter-to-submit'?: boolean; /** * 数据改变时触发 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; -} +}> -export declare class Submit { -} +export declare const Submit: DefineComponent<{ +}> -export declare class Login { +export declare const Login: DefineComponent<{ /** * 提交时触发,返回值1 valid 为 表单验证是否通过,返回值2 data 包含了指定 Login 组件的绑定值 */ - $emit(eventName: 'on-submit'): this; + onOnSubmit?: (event?: any) => any; -} +}> diff --git a/types/menu.d.ts b/types/menu.d.ts index de4b72d33..2d7baf021 100644 --- a/types/menu.d.ts +++ b/types/menu.d.ts @@ -1,98 +1,100 @@ -export declare class Menu { +import type { DefineComponent } from 'vue'; + +export declare const Menu: DefineComponent<{ /** * 菜单类型,可选值为 `horizontal`(水平) 和 `vertical`(垂直) */ - mode: 'horizontal' | 'vertical'; + mode?: 'horizontal' | 'vertical'; /** * 主题,可选值为 `light`、`dark`、`primary`,其中 primary 只适用于 `mode="horizontal"` */ - theme: 'light' | 'dark' | 'primary'; + theme?: 'light' | 'dark' | 'primary'; /** * 激活菜单的 name 值 */ - 'active-name': string | number; + 'active-name'?: string | number; /** * 展开的 Submenu 的 name 集合 */ - 'open-names': []; + 'open-names'?: any[]; /** * 是否开启手风琴模式,开启后每次至多展开一个子菜单 */ - accordion: boolean; + accordion?: boolean; /** * 导航菜单的宽度,只在 `mode="vertical"` 时有效,如果使用 `Col` 等布局,建议设置为 `auto` */ - width: string; + width?: string; /** * 选择菜单(MenuItem)时触发 */ - $emit(eventName: 'on-select'): this; + onOnSelect?: (event?: any) => any; /** * 当 展开/收起 子菜单时触发 */ - $emit(eventName: 'on-open-change'): this; + onOnOpenChange?: (event?: any) => any; -} +}> -export declare class MenuItem { +export declare const MenuItem: DefineComponent<{ /** * 菜单项的唯一标识,必填 */ - name: string | number; + name?: string | number; /** * 跳转的链接,支持 vue-router 对象 */ - to: string | object; + to?: string | object; /** * 路由跳转时,开启 replace 将不会向 history 添加新记录 */ - replace: boolean; + replace?: boolean; /** * 相当于 a 链接的 target 属性 */ - target: '_blank' | '_self' | '_parent' | '_top'; + target?: '_blank' | '_self' | '_parent' | '_top'; /** * 同 vue-router append */ - append: boolean; + append?: boolean; -} +}> -export declare class Submenu { +export declare const Submenu: DefineComponent<{ /** * 子菜单的唯一标识,必填 */ - name: string | number; + name?: string | number; - $slots: { + 'v-slots'?: { /** * 菜单项 */ - '': []; + default?: () => any; /** * 子菜单标题 */ - title: []; + title?: () => any; }; -} +}> -export declare class MenuGroup { +export declare const MenuGroup: DefineComponent<{ /** * 分组标题 */ - title: string; + title?: string; -} +}> diff --git a/types/message.d.ts b/types/message.d.ts index 755b33442..78344dd72 100644 --- a/types/message.d.ts +++ b/types/message.d.ts @@ -1,45 +1,47 @@ -export declare class Message { +import type { DefineComponent } from 'vue'; + +export declare const Message: DefineComponent<{ /** * 提示内容 */ - content: string; + content?: string; /** * 自定义描述内容,使用 Vue 的 Render 函数 */ - render: Function; + render?: Function; /** * 自动关闭的延时,单位秒,不关闭可以写 0 */ - duration: number; + duration?: number; /** * 关闭时的回调 */ - onClose: Function; + onClose?: Function; /** * 是否显示关闭按钮 */ - closable: boolean; + closable?: boolean; /** * 是否显示背景色 */ - background: boolean; + background?: boolean; -} +}> -export declare class MessageConfig { +export declare const MessageConfig: { /** * 提示组件距离顶端的距离,单位像素 */ - top: number; + top?: number; /** * 默认自动关闭的延时,单位秒 */ - duration: number; + duration?: number; } diff --git a/types/modal.d.ts b/types/modal.d.ts index db9c12d0f..51a13b09f 100644 --- a/types/modal.d.ts +++ b/types/modal.d.ts @@ -1,217 +1,219 @@ -export declare class Modal { +import type { DefineComponent } from 'vue'; + +export declare const Modal: DefineComponent<{ /** * 对话框是否显示,可使用 v-model 双向绑定数据。 */ - 'model-value': boolean; + 'model-value'?: boolean; /** * 对话框标题,如果使用 slot 自定义了页头,则 title 无效 */ - title: string; + title?: string; /** * 是否显示右上角的关闭按钮,关闭后 Esc 按键也将关闭 */ - closable: boolean; + closable?: boolean; /** * 是否允许点击遮罩层关闭 */ - 'mask-closable': boolean; + 'mask-closable'?: boolean; /** * 点击确定按钮时,确定按钮是否显示 loading 状态,开启则需手动设置`value`来关闭对话框 */ - loading: boolean; + loading?: boolean; /** * 页面是否可以滚动 */ - scrollable: boolean; + scrollable?: boolean; /** * 是否全屏显示 */ - fullscreen: boolean; + fullscreen?: boolean; /** * 是否可以拖拽移动 */ - draggable: boolean; + draggable?: boolean; /** * 拖拽时,是否吸附屏幕边缘 */ - sticky: boolean; + sticky?: boolean; /** * 拖拽时,自动吸附屏幕边缘的临界距离 */ - 'sticky-distance': number; + 'sticky-distance'?: number; /** * Modal 再次打开时,是否重置拖拽的位置 */ - 'reset-drag-position': boolean; + 'reset-drag-position'?: boolean; /** * 是否显示遮罩层,开启 draggable 时,强制不显示(4.6.0不再强制) */ - mask: boolean; + mask?: boolean; /** * 确定按钮文字 */ - 'ok-text': string; + 'ok-text'?: string; /** * 取消按钮文字 */ - 'cancel-text': string; + 'cancel-text'?: string; /** * 对话框宽度,对话框的宽度是响应式的,当屏幕尺寸小于 768px 时,宽度会变为自动`auto`。当其值不大于 100 时以百分比显示,大于 100 时为像素 */ - width: number; + width?: number; /** * 不显示底部 */ - 'footer-hide': boolean; + 'footer-hide'?: boolean; /** * 设置浮层样式,调整浮层位置等,该属性设置的是`.ivu-modal`的样式 */ - styles: object; + styles?: object; /** * 设置对话框容器`.ivu-modal-wrap`的类名,可辅助实现垂直居中等自定义效果 */ - 'class-name': string; + 'class-name'?: string; /** * 层级 */ - 'z-index': number; + 'z-index'?: number; /** * 自定义显示动画,第一项是模态框,第二项是背景 */ - 'transition-names': []; + 'transition-names'?: any[]; /** * 是否将弹层放置于 body 内 */ - transfer: boolean; + transfer?: boolean; /** * 是否禁止对页面滚动条的修改 */ - 'lock-scroll': boolean; + 'lock-scroll'?: boolean; /** * 返回 Promise 可以阻止关闭 */ - 'before-close': Function; + 'before-close'?: Function; /** * 点击确定的回调 */ - $emit(eventName: 'on-ok'): this; + onOnOk?: (event?: any) => any; /** * 点击取消的回调 */ - $emit(eventName: 'on-cancel'): this; + onOnCancel?: (event?: any) => any; /** * 显示状态发生变化时触发 */ - $emit(eventName: 'on-visible-change'): this; + onOnVisibleChange?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 自定义页头 */ - header: []; + header?: () => any; /** * 自定义页脚内容 */ - footer: []; + footer?: () => any; /** * 自定义右上角关闭内容 */ - close: []; + close?: () => any; /** * 对话框主体内容 */ - '': []; + default?: () => any; }; -} +}> -export declare class ModalInstance { +export declare const ModalInstance: DefineComponent<{ /** * 标题 */ - title: string | Element; + title?: string | Element; /** * 内容 */ - content: string | Element; + content?: string | Element; /** * 自定义内容,使用后不再限制类型, content 也无效。 */ - render: Function; + render?: Function; /** * 宽度,单位 px */ - width: number | string; + width?: number | string; /** * 确定按钮的文字 */ - okText: string; + okText?: string; /** * 取消按钮的文字,只在`Modal.confirm()`下有效 */ - cancelText: string; + cancelText?: string; /** * 点击确定按钮时,确定按钮是否显示 loading 状态,开启则需手动调用`Modal.remove()`来关闭对话框 */ - loading: boolean; + loading?: boolean; /** * 页面是否可以滚动 */ - scrollable: boolean; + scrollable?: boolean; /** * 是否可以按 Esc 键关闭 */ - closable: boolean; + closable?: boolean; /** * 点击确定的回调 */ - onOk: Function; + onOk?: Function; /** * 点击取消的回调,只在`Modal.confirm()`下有效 */ - onCancel: Function; + onCancel?: Function; /** * 是否禁止对页面滚动条的修改 */ - 'lock-scroll': boolean; + 'lock-scroll'?: boolean; -} +}> diff --git a/types/notice.d.ts b/types/notice.d.ts index 74e8da8ce..458639803 100644 --- a/types/notice.d.ts +++ b/types/notice.d.ts @@ -1,45 +1,47 @@ -export declare class Notice { +import type { DefineComponent } from 'vue'; + +export declare const Notice: DefineComponent<{ /** * 通知提醒的标题 */ - title: string; + title?: string; /** * 通知提醒的内容,为空或不填时,自动应用仅标题模式下的样式 */ - desc: string; + desc?: string; /** * 自定义描述内容,使用 Vue 的 Render 函数,如果同时设置了 render 和 desc,则只显示 render 的内容 */ - render: Function; + render?: Function; /** * 自动关闭的延时,单位秒,不关闭可以写 0 */ - duration: number; + duration?: number; /** * 当前通知的唯一标识 */ - name: string; + name?: string; /** * 关闭时的回调 */ - onClose: Function; + onClose?: Function; -} +}> -export declare class NoticeConfig { +export declare const NoticeConfig: { /** * 通知组件距离顶端的距离,单位像素 */ - top: number; + top?: number; /** * 默认自动关闭的延时,单位秒 */ - duration: number; + duration?: number; } diff --git a/types/notification.d.ts b/types/notification.d.ts index 9b380015e..32529cabf 100644 --- a/types/notification.d.ts +++ b/types/notification.d.ts @@ -1,289 +1,291 @@ -export declare class Notification { +import type { DefineComponent } from 'vue'; + +export declare const Notification: DefineComponent<{ /** * 图标上的消息总数 */ - count: number; + count?: number; /** * 是否根基 Tab 的 count 自动计算 count,开启,则 count 无效 */ - 'auto-count': boolean; + 'auto-count'?: boolean; /** * Tab 的 count 是纯文本显示,还是 Badge 显示,可选值为 text 或 badge */ - 'count-type': string; + 'count-type'?: string; /** * 图标 (铃铛),也有同名 slot */ - icon: string; + icon?: string; /** * 是否将弹层放置于 body 内 */ - transfer: boolean; + transfer?: boolean; /** * 弹窗的展开方向,支持 12 个方向 */ - placement: string; + placement?: string; /** * 额外的 Badge 配置 */ - 'badge-props': object; + 'badge-props'?: object; /** * 点击清空按钮后关闭通知菜单 */ - 'clear-close': boolean; + 'clear-close'?: boolean; /** * 当前显示哪一个面板,基于 Tab 的 name */ - tab: string; + tab?: string; /** * 开启后,宽度是100%而不是默认的300px,在移动端等环境下使用较好 */ - wide: boolean; + wide?: boolean; /** * 默认文案 */ - locale: object; + locale?: object; /** * 点击清空时触发,返回 tab 内容,包含 name 和 title */ - $emit(eventName: 'on-clear'): this; + onOnClear?: (event?: any) => any; /** * 点击加载更多时触发,返回 tab 内容 */ - $emit(eventName: 'on-load-more'): this; + onOnLoadMore?: (event?: any) => any; /** * 切换页签时触发,返回 tab 内容 */ - $emit(eventName: 'on-tab-change'): this; + onOnTabChange?: (event?: any) => any; /** * 点击 item 项时触发,返回 tab 和 item(其中 item 返回的是 attrs 而不是 props) */ - $emit(eventName: 'on-item-click'): this; + onOnItemClick?: (event?: any) => any; /** * 菜单显示状态改变时调用 */ - $emit(eventName: 'on-visible-change'): this; + onOnVisibleChange?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 自定义铃铛 */ - icon: []; + icon?: () => any; /** * 底部附加信息,常见有设置、查看全部等功能 */ - extra: []; + extra?: () => any; }; -} +}> -export declare class NotificationTab { +export declare const NotificationTab: DefineComponent<{ /** * 当前 tab 的消息总数 */ - count: number; + count?: number; /** * 消息分类的页签标题,必填 */ - title: string; + title?: string; /** * 当前 tab 标识 */ - name: string; + name?: string; /** * 没有通知的文案 */ - 'empty-text': string; + 'empty-text'?: string; /** * 没有通知的图标 */ - 'empty-image': string; + 'empty-image'?: string; /** * 已加载完所有消息 */ - 'loaded-all': boolean; + 'loaded-all'?: boolean; /** * 是否显示已加载完所有消息 */ - 'show-loaded-all': boolean; + 'show-loaded-all'?: boolean; /** * 当前 Tab 的加载状态 */ - loading: boolean; + loading?: boolean; /** * 是否允许滚动到底部自动加载 */ - 'scroll-to-load': boolean; + 'scroll-to-load'?: boolean; /** * 是否显示清空按钮 */ - 'show-clear': boolean; + 'show-clear'?: boolean; /** * 是否显示清空按钮前的图标 */ - 'show-clear-icon': boolean; + 'show-clear-icon'?: boolean; - $slots: { + 'v-slots'?: { /** * 顶部,比如:这些人最近关注了你 */ - top: []; + top?: () => any; /** * 自定义通知为空时的内容 */ - empty: []; + empty?: () => any; /** * 自定义加载中的内容 */ - loading: []; + loading?: () => any; /** * 自定义加载更多的内容 */ - 'load-more': []; + 'load-more'?: () => any; /** * 自定义已完成加载的内容 */ - 'loaded-all': []; + 'loaded-all'?: () => any; /** * 自定义清空全部的内容 */ - clear: []; + clear?: () => any; }; -} +}> -export declare class NotificationItem { +export declare const NotificationItem: DefineComponent<{ /** * Row 的配置,默认垂直居中 */ - 'row-props': object; + 'row-props'?: object; /** * 是否已读,1 和 true 是已读,0 和 false 是未读 */ - read: boolean | number; + read?: boolean | number; /** * 小图标 */ - icon: string; + icon?: string; /** * 自定义小图标 */ - 'custom-icon': string; + 'custom-icon'?: string; /** * 小图标的颜色 */ - 'icon-color': string; + 'icon-color'?: string; /** * 小图标尺寸,可选值为 small、default、large */ - 'icon-size': string; + 'icon-size'?: string; /** * 头像地址 */ - avatar: string; + avatar?: string; /** * 头像形状,可选值为 circle 或 square */ - 'avatar-shape': string; + 'avatar-shape'?: string; /** * 标题 */ - title: string; + title?: string; /** * 内容 */ - content: string; + content?: string; /** * 时间,会转为相对时间 */ - time: number | Date | string; + time?: number | Date | string; /** * 相对时间配置 */ - 'time-props': object; + 'time-props'?: object; /** * 标签 */ - tag: string; + tag?: string; /** * 标签配置 */ - 'tag-props': object; + 'tag-props'?: object; /** * 点击列表项关闭通知菜单 */ - 'click-close': boolean; + 'click-close'?: boolean; /** * 点击 item 项时触发,返回 item(item 返回的是 attrs 而不是 props) */ - $emit(eventName: 'on-item-click'): this; + onOnItemClick?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 如果想完全自定义 NotificationItem 内容,可以使用默认的 slot,否则不建议覆盖此 slot 内容 */ - default: []; + default?: () => any; /** * 自定义标题 */ - title: []; + title?: () => any; /** * 自定义内容 */ - content: []; + content?: () => any; /** * 自定义时间 */ - time: []; + time?: () => any; }; -} +}> diff --git a/types/number-info.d.ts b/types/number-info.d.ts index 1afe659d6..b908f962d 100644 --- a/types/number-info.d.ts +++ b/types/number-info.d.ts @@ -1,54 +1,56 @@ -export declare class NumberInfo { +import type { DefineComponent } from 'vue'; + +export declare const NumberInfo: DefineComponent<{ /** * 标题 */ - title: string; + title?: string; /** * 子标题 */ - 'sub-title': string; + 'sub-title'?: string; /** * 总量 */ - total: string | number; + total?: string | number; /** * 子总量 */ - 'sub-total': string | number; + 'sub-total'?: string | number; /** * 增加状态,可选值为 up 或 down */ - status: string; + status?: string; /** * 设置数字和描述之间的间距,单位:px */ - gap: string | number; + gap?: string | number; - $slots: { + 'v-slots'?: { /** * 自定义标题 */ - title: []; + title?: () => any; /** * 自定义子标题 */ - subTitle: []; + subTitle?: () => any; /** * 自定义总量 */ - total: []; + total?: () => any; /** * 自定义子总量 */ - subTotal: []; + subTotal?: () => any; }; -} +}> diff --git a/types/numeral.d.ts b/types/numeral.d.ts index 4966a8b13..82f2baea4 100644 --- a/types/numeral.d.ts +++ b/types/numeral.d.ts @@ -1,39 +1,41 @@ -export declare class Numeral { +import type { DefineComponent } from 'vue'; + +export declare const Numeral: DefineComponent<{ /** * 数值, 也可以直接使用 v-model */ - 'model-value': number | string; + 'model-value'?: number | string; /** * 格式, [查看所有格式](https://run.iviewui.com/preview/d7868Je4) */ - format: string; + format?: string; /** * 前缀 */ - prefix: string | number; + prefix?: string | number; /** * 后缀 */ - suffix: string | number; + suffix?: string | number; /** * 格式化好时触发,返回格式化后的内容 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 自定义前缀 */ - prefix: []; + prefix?: () => any; /** * 自定义后缀 */ - suffix: []; + suffix?: () => any; }; -} +}> diff --git a/types/page-header.d.ts b/types/page-header.d.ts index 0dd75fd95..7dd403dee 100644 --- a/types/page-header.d.ts +++ b/types/page-header.d.ts @@ -1,99 +1,101 @@ -export declare class PageHeader { +import type { DefineComponent } from 'vue'; + +export declare const PageHeader: DefineComponent<{ /** * 自定义标题文字 */ - title: string; + title?: string; /** * 是否显示返回按钮 */ - back: boolean; + back?: boolean; /** * 自定义 logo */ - logo: string; + logo?: string; /** * 操作区,位于 title 行的行尾 */ - action: string; + action?: string; /** * 内容区 */ - content: string; + content?: string; /** * 额外内容区,位于 content 的右侧 */ - extra: string; + extra?: string; /** * 面包屑数据,可支配的属性有:to、replace、target、title,详见 View UI Plus Breadcrumb 组件。 */ - 'breadcrumb-list': []; + 'breadcrumb-list'?: any[]; /** * 是否关闭面包屑 */ - 'hidden-breadcrumb': boolean; + 'hidden-breadcrumb'?: boolean; /** * Tabs 选项卡数据,可支配属性有:label、name。 */ - 'tab-list': []; + 'tab-list'?: any[]; /** * 当前高亮的 tab 项 */ - 'tab-active-key': string; + 'tab-active-key'?: string; /** * 是否定宽,开启后,最大宽度为 1200px,否则自适应宽度 */ - wide: boolean; + wide?: boolean; /** * 切换 Tabs 选项卡时触发 */ - $emit(eventName: 'on-tab-change'): this; + onOnTabChange?: (event?: any) => any; /** * 点击返回按钮时触发 */ - $emit(eventName: 'on-back'): this; + onOnBack?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 自定义标题 */ - title: []; + title?: () => any; /** * 自定义返回区域 */ - back: []; + back?: () => any; /** * 自定义 logo */ - logo: []; + logo?: () => any; /** * 自定义操作区 */ - action: []; + action?: () => any; /** * 自定义内容区 */ - content: []; + content?: () => any; /** * 自定义额外内容区 */ - extra: []; + extra?: () => any; }; -} +}> diff --git a/types/page.d.ts b/types/page.d.ts index 78907e942..a64287d34 100644 --- a/types/page.d.ts +++ b/types/page.d.ts @@ -1,114 +1,116 @@ -export declare class Page { +import type { DefineComponent } from 'vue'; + +export declare const Page: DefineComponent<{ /** * 当前页码, 可以使用 v-model来进行双向绑定 */ - 'model-value': number; + 'model-value'?: number; /** * 数据总数 */ - total: number; + total?: number; /** * 每页条数 */ - 'page-size': number; + 'page-size'?: number; /** * 每页条数切换的配置 */ - 'page-size-opts': []; + 'page-size-opts'?: any[]; /** * 条数切换弹窗的展开方向,可选值为 `bottom` 和 `top` */ - placement: string; + placement?: string; /** * 可选值为`small`(迷你版)、`default`(默认)或不填 */ - size: string; + size?: string; /** * 简洁版 */ - simple: boolean; + simple?: boolean; /** * 显示总数 */ - 'show-total': boolean; + 'show-total'?: boolean; /** * 显示电梯,可以快速切换到某一页 */ - 'show-elevator': boolean; + 'show-elevator'?: boolean; /** * 显示分页,用来改变`page-size` */ - 'show-sizer': boolean; + 'show-sizer'?: boolean; /** * 自定义 class 名称 */ - 'class-name': string; + 'class-name'?: string; /** * 自定义 style 样式 */ - styles: object; + styles?: object; /** * 是否将弹层放置于 body 内,在 Tabs、带有 fixed 的 Table 列内使用时,建议添加此属性,它将不受父级样式影响,从而达到更好的效果 */ - transfer: boolean; + transfer?: boolean; /** * 替代图标显示的上一页文字 */ - 'prev-text': string; + 'prev-text'?: string; /** * 替代图标显示的下一页文字 */ - 'next-text': string; + 'next-text'?: string; /** * 是否禁用 */ - disabled: boolean; + disabled?: boolean; /** * 是否开启 Popper 的 eventsEnabled 属性,开启可能会牺牲一定的性能 */ - 'events-enabled': boolean; + 'events-enabled'?: boolean; /** * 页码改变的回调,返回改变后的页码 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; /** * 切换每页条数时的回调,返回切换后的每页条数 */ - $emit(eventName: 'on-page-size-change'): this; + onOnPageSizeChange?: (event?: any) => any; /** * 切换上一页时触发,返回切换后的页码 */ - $emit(eventName: 'on-prev'): this; + onOnPrev?: (event?: any) => any; /** * 切换下一页时触发,返回切换后的页码 */ - $emit(eventName: 'on-next'): this; + onOnNext?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 自定义显示总数的内容 */ - '': []; + default?: () => any; }; -} +}> diff --git a/types/poptip.d.ts b/types/poptip.d.ts index f52d3e271..1256cf2cf 100644 --- a/types/poptip.d.ts +++ b/types/poptip.d.ts @@ -1,124 +1,126 @@ -export declare class Poptip { +import type { DefineComponent } from 'vue'; + +export declare const Poptip: DefineComponent<{ /** * 触发方式,可选值为`hover`(悬停)`click`(点击)`focus`(聚焦),在 confirm 模式下,只有 click 有效 */ - trigger: string; + trigger?: string; /** * 显示的标题 */ - title: string | number; + title?: string | number; /** * 显示的正文内容,只在非 confirm 模式下有效 */ - content: string | number; + content?: string | number; /** * 提示框出现的位置,可选值为`top``top-start``top-end``bottom``bottom-start``bottom-end``left``left-start``left-end``right``right-start``right-end` */ - placement: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; + placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; /** * 宽度,最小宽度为 150px,在 confirm 模式下,默认最大宽度为 300px */ - width: string | number; + width?: string | number; /** * 是否开启对话框模式 */ - confirm: boolean; + confirm?: boolean; /** * 是否禁用 */ - disabled: boolean; + disabled?: boolean; /** * 确定按钮的文字,只在 confirm 模式下有效 */ - 'ok-text': string; + 'ok-text'?: string; /** * 取消按钮的文字,只在 confirm 模式下有效 */ - 'cancel-text': string; + 'cancel-text'?: string; /** * 是否将弹层放置于 body 内,在 Tabs、带有 fixed 的 Table 列内使用时,建议添加此属性,它将不受父级样式影响,从而达到更好的效果 */ - transfer: boolean; + transfer?: boolean; /** * 给 Poptip 设置 class-name,在使用 transfer 时会很有用 */ - 'popper-class': string; + 'popper-class'?: string; /** * 开启后,超出指定宽度文本将自动换行,并两端对齐 */ - 'word-wrap': boolean; + 'word-wrap'?: boolean; /** * 自定义间距值 */ - padding: string; + padding?: string; /** * 出现位置的偏移量 */ - offset: number; + offset?: number; /** * 自定义 popper.js 的配置项,具体配置见 [popper.js 文档](https://popper.js.org/popper-documentation.html){target:"_blank"} */ - options: object; + options?: object; /** * 开启 transfer 时,给浮层添加额外的 class 名称 */ - 'transfer-class-name': string; + 'transfer-class-name'?: string; /** * 是否开启 Popper 的 eventsEnabled 属性,开启可能会牺牲一定的性能 */ - 'events-enabled': boolean; + 'events-enabled'?: boolean; /** * 在提示框显示时触发 */ - $emit(eventName: 'on-popper-show'): this; + onOnPopperShow?: (event?: any) => any; /** * 在提示框消失时触发 */ - $emit(eventName: 'on-popper-hide'): this; + onOnPopperHide?: (event?: any) => any; /** * 点击确定的回调,只在 confirm 模式下有效 */ - $emit(eventName: 'on-ok'): this; + onOnOk?: (event?: any) => any; /** * 点击取消的回调,只在 confirm 模式下有效 */ - $emit(eventName: 'on-cancel'): this; + onOnCancel?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 主体内容 */ - '': []; + default?: () => any; /** * 提示框标题,定义此 slot 时,会覆盖 props `title` */ - title: []; + title?: () => any; /** * 提示框内容,定义此 slot 时,会覆盖 props `content`,只在非 confirm 模式下有效 */ - content: []; + content?: () => any; }; -} +}> diff --git a/types/progress.d.ts b/types/progress.d.ts index 74596f808..582510e86 100644 --- a/types/progress.d.ts +++ b/types/progress.d.ts @@ -1,49 +1,51 @@ -export declare class Progress { +import type { DefineComponent } from 'vue'; + +export declare const Progress: DefineComponent<{ /** * 百分比 */ - percent: number; + percent?: number; /** * 状态,可选值为`normal`、`active`、`wrong`、`success` */ - status: 'normal' | 'active' | 'wrong' | 'success'; + status?: 'normal' | 'active' | 'wrong' | 'success'; /** * 进度条的线宽,单位 px */ - 'stroke-width': number; + 'stroke-width'?: number; /** * 进度条的颜色,支持传入数组,显示为渐变色 */ - 'stroke-color': string | []; + 'stroke-color'?: string | any[]; /** * 隐藏数值或状态图标 */ - 'hide-info': boolean; + 'hide-info'?: boolean; /** * 是否在垂直方向显示 */ - vertical: boolean; + vertical?: boolean; /** * 已完成的分段百分比 */ - 'success-percent': number; + 'success-percent'?: number; /** * 百分比是否置于进度条内 */ - 'text-inside': boolean; + 'text-inside'?: boolean; - $slots: { + 'v-slots'?: { /** * 自定义显示状态内容 */ - '': []; + default?: () => any; }; -} +}> diff --git a/types/radio.d.ts b/types/radio.d.ts index 303d8a2e5..1e6f3087b 100644 --- a/types/radio.d.ts +++ b/types/radio.d.ts @@ -1,75 +1,77 @@ -export declare class Radio { +import type { DefineComponent } from 'vue'; + +export declare const Radio: DefineComponent<{ /** * 只在单独使用时有效。可以使用 `v-model` 双向绑定数据 */ - 'model-value': boolean; + 'model-value'?: boolean; /** * 只在组合使用时有效。指定当前选项的 value 值,组合会自动判断当前选择的项目 */ - label: string | number; + label?: string | number; /** * 是否禁用当前项 */ - disabled: boolean; + disabled?: boolean; /** * 单选框的尺寸,可选值为 `large`、`small`、`default` 或者不设置 */ - size: '' | 'large' | 'small' | 'default'; + size?: '' | 'large' | 'small' | 'default'; /** * 是否显示边框 */ - border: boolean; + border?: boolean; /** * 选中时的值,当使用类似 1 和 0 来判断是否选中时会很有用 */ - 'true-value': string | number | boolean; + 'true-value'?: string | number | boolean; /** * 没有选中时的值,当使用类似 1 和 0 来判断是否选中时会很有用 */ - 'false-value': string | number | boolean; + 'false-value'?: string | number | boolean; /** * 在选项状态发生改变时触发,返回当前状态。通过修改外部的数据改变时不会触发 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; -} +}> -export declare class RadioGroup { +export declare const RadioGroup: DefineComponent<{ /** * 指定当前选中的项目数据。可以使用 `v-model` 双向绑定数据 */ - 'model-value': string | number; + 'model-value'?: string | number; /** * 可选值为 button 或不填,为 button 时使用按钮样式 */ - type: string; + type?: string; /** * 按钮样式,可选值为 default 和 solid */ - 'button-style': string; + 'button-style'?: string; /** * 尺寸,可选值为`large`、`small`、`default`或者不设置 */ - size: '' | 'large' | 'small' | 'default'; + size?: '' | 'large' | 'small' | 'default'; /** * 是否垂直排列,按钮样式下无效 */ - vertical: boolean; + vertical?: boolean; /** * 在选项状态发生改变时触发,返回当前选中的项。通过修改外部的数据改变时不会触发 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; -} +}> diff --git a/types/rate.d.ts b/types/rate.d.ts index f95543012..1ace24cf0 100644 --- a/types/rate.d.ts +++ b/types/rate.d.ts @@ -1,52 +1,54 @@ -export declare class Rate { +import type { DefineComponent } from 'vue'; + +export declare const Rate: DefineComponent<{ /** * star 总数 */ - count: number; + count?: number; /** * 当前 star 数,可以使用 v-model 双向绑定数据 */ - 'model-value': number; + 'model-value'?: number; /** * 是否允许半选 */ - 'allow-half': boolean; + 'allow-half'?: boolean; /** * 是否只读,无法进行交互 */ - disabled: boolean; + disabled?: boolean; /** * 是否显示提示文字 */ - 'show-text': boolean; + 'show-text'?: boolean; /** * 是否可以取消选择 */ - clearable: boolean; + clearable?: boolean; /** * 自定义字符 */ - character: string; + character?: string; /** * 使用图标 */ - icon: string; + icon?: string; /** * 使用自定义图标 */ - 'custom-icon': string; + 'custom-icon'?: string; /** * 评分改变时触发 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; -} +}> diff --git a/types/result.d.ts b/types/result.d.ts index c5af19172..88e9a2065 100644 --- a/types/result.d.ts +++ b/types/result.d.ts @@ -1,44 +1,46 @@ -export declare class Result { +import type { DefineComponent } from 'vue'; + +export declare const Result: DefineComponent<{ /** * 类型,不同类型自带对应的图标,可选值为 `success`、`error`、`warning` */ - type: 'success' | 'error' | 'warning'; + type?: 'success' | 'error' | 'warning'; /** * 标题 */ - title: string; + title?: string; /** * 结果描述 */ - desc: string; + desc?: string; /** * 补充信息,有默认的灰色背景 */ - extra: string; + extra?: string; - $slots: { + 'v-slots'?: { /** * 自定义标题 */ - title: []; + title?: () => any; /** * 自定义结果描述 */ - desc: []; + desc?: () => any; /** * 自定义补充信息 */ - extra: []; + extra?: () => any; /** * 操作建议,推荐放置跳转链接,按钮组等 */ - actions: []; + actions?: () => any; }; -} +}> diff --git a/types/row.d.ts b/types/row.d.ts index 8b96e3d2b..9293bd960 100644 --- a/types/row.d.ts +++ b/types/row.d.ts @@ -1,95 +1,97 @@ -export declare class Row { +import type { DefineComponent } from 'vue'; + +export declare const Row: DefineComponent<{ /** * 栅格间距,单位 px,左右平分 */ - gutter: number; + gutter?: number; /** * flex 布局下的垂直对齐方式,可选值为 `top`、`middle`、`bottom` */ - align: 'top' | 'middle' | 'bottom'; + align?: 'top' | 'middle' | 'bottom'; /** * 布局下的水平排列方式,可选值为 `start`、`end`、`center`、`space-around`、`space-between` */ - justify: 'start' | 'end' | 'center' | 'space-around' | 'space-between'; + justify?: 'start' | 'end' | 'center' | 'space-around' | 'space-between'; /** * 自定义的class名称 */ - 'class-name': string; + 'class-name'?: string; /** * 是否自动换行 */ - wrap: boolean; + wrap?: boolean; -} +}> -export declare class Col { +export declare const Col: DefineComponent<{ /** * 栅格的占位格数,可选值为0~24的整数,为 0 时,相当于 `display:none` */ - span: number | string; + span?: number | string; /** * flex 布局属性 */ - flex: number | string; + flex?: number | string; /** * 栅格的顺序,在 `flex` 布局模式下有效 */ - order: number | string; + order?: number | string; /** * 栅格左侧的间隔格数,间隔内不可以有栅格 */ - offset: number | string; + offset?: number | string; /** * 栅格向右移动格数 */ - push: number | string; + push?: number | string; /** * 栅格向左移动格数 */ - pull: number | string; + pull?: number | string; /** * 自定义的class名称 */ - 'class-name': string; + 'class-name'?: string; /** * `<576px` 响应式栅格,可为栅格数或一个包含其他属性的对象 */ - xs: string | object; + xs?: string | object; /** * `>=576px` 响应式栅格,可为栅格数或一个包含其他属性的对象 */ - sm: string | object; + sm?: string | object; /** * `>=768px` 响应式栅格,可为栅格数或一个包含其他属性的对象 */ - md: string | object; + md?: string | object; /** * `>=992px` 响应式栅格,可为栅格数或一个包含其他属性的对象 */ - lg: string | object; + lg?: string | object; /** * `>=1200px` 响应式栅格,可为栅格数或一个包含其他属性的对象 */ - xl: string | object; + xl?: string | object; /** * `>=1600px` 响应式栅格,可为栅格数或一个包含其他属性的对象 */ - xxl: string | object; + xxl?: string | object; -} +}> diff --git a/types/scroll.d.ts b/types/scroll.d.ts index fedb99308..b6835a766 100644 --- a/types/scroll.d.ts +++ b/types/scroll.d.ts @@ -1,32 +1,34 @@ -export declare class Scroll { +import type { DefineComponent } from 'vue'; + +export declare const Scroll: DefineComponent<{ /** * 滚动区域的高度,单位像素 */ - height: string | number; + height?: string | number; /** * 加载中的文案 */ - 'loading-text': string; + 'loading-text'?: string; /** * 滚动至顶部时触发,需返回 Promise */ - 'on-reach-top': Function; + 'on-reach-top'?: Function; /** * 滚动至底部时触发,需返回 Promise */ - 'on-reach-bottom': Function; + 'on-reach-bottom'?: Function; /** * 滚动至顶部或底部时触发,需返回 Promise */ - 'on-reach-edge': Function; + 'on-reach-edge'?: Function; /** * 从边缘到触发回调的距离。如果是负的,回调将在到达边缘之前触发。值最好在 24 以下。 */ - 'distance-to-edge': number | []; + 'distance-to-edge'?: number | any[]; -} +}> diff --git a/types/select.d.ts b/types/select.d.ts index ff5e1be9e..aa40580cf 100644 --- a/types/select.d.ts +++ b/types/select.d.ts @@ -1,195 +1,197 @@ -export declare class Select { +import type { DefineComponent } from 'vue'; + +export declare const Select: DefineComponent<{ /** * 指定选中项目的 value 值,可以使用 v-model 双向绑定数据。单选时只接受 String 或 Number,多选时只接受 Array|String | Number | Array */ - 'model-value': ''; + 'model-value'?: ''; /** * 是否支持多选 */ - multiple: boolean; + multiple?: boolean; /** * 是否禁用 */ - disabled: boolean; + disabled?: boolean; /** * 是否可以清空选项,只在单选时有效 */ - clearable: boolean; + clearable?: boolean; /** * 是否支持搜索 */ - filterable: boolean; + filterable?: boolean; /** * 在搜索时,是否只按照 label 进行搜索 */ - 'filter-by-label': boolean; + 'filter-by-label'?: boolean; /** * 远程搜索的方法 */ - 'remote-method': Function; + 'remote-method'?: Function; /** * 当前是否正在远程搜索 */ - loading: boolean; + loading?: boolean; /** * 远程搜索中的文字提示 */ - 'loading-text': string; + 'loading-text'?: string; /** * 远程搜索时,显示默认 label,详见示例 */ - 'default-label': string | number | []; + 'default-label'?: string | number | any[]; /** * 选择框大小,可选值为`large`、`small`、`default`或者不填 */ - size: '' | 'large' | 'small' | 'default'; + size?: '' | 'large' | 'small' | 'default'; /** * 选择框默认文字 */ - placeholder: string; + placeholder?: string; /** * 当下拉列表为空时显示的内容 */ - 'not-found-text': string; + 'not-found-text'?: string; /** * 在返回选项时,是否将 label 和 value 一并返回,默认只返回 value */ - 'label-in-value': boolean; + 'label-in-value'?: boolean; /** * 弹窗的展开方向,可选值为 `top`、`bottom`、`top-start`、`bottom-start`、`top-end`、`bottom-end` */ - placement: 'bottom' | 'top' | 'top-start' | 'bottom-start' | 'top-end' | 'bottom-end'; + placement?: 'bottom' | 'top' | 'top-start' | 'bottom-start' | 'top-end' | 'bottom-end'; /** * 是否将弹层放置于 body 内,在 Tabs、带有 fixed 的 Table 列内使用时,建议添加此属性,它将不受父级样式影响,从而达到更好的效果 */ - transfer: boolean; + transfer?: boolean; /** * 给表单元素设置 `id`,详见 Form 用法。 */ - 'element-id': string; + 'element-id'?: string; /** * 开启 transfer 时,给浮层添加额外的 class 名称 */ - 'transfer-class-name': string; + 'transfer-class-name'?: string; /** * 在 Select 内显示图标 */ - prefix: string; + prefix?: string; /** * 多选时最多显示多少个 tag */ - 'max-tag-count': number; + 'max-tag-count'?: number; /** * 隐藏 tag 时显示的内容,参数是剩余项数量 */ - 'max-tag-placeholder': Function; + 'max-tag-placeholder'?: Function; /** * 是否允许用户创建新条目,需开启 filterable */ - 'allow-create': boolean; + 'allow-create'?: boolean; /** * 是否开启 capture 模式,也可通过全局配置 */ - capture: boolean; + capture?: boolean; /** * 是否开启 Popper 的 eventsEnabled 属性,开启可能会牺牲一定的性能 */ - 'events-enabled': boolean; + 'events-enabled'?: boolean; /** * 选中的`Option`变化时触发,默认返回 value,如需返回 label,详见 label-in-value 属性 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; /** * 搜索词改变时触发 */ - $emit(eventName: 'on-query-change'): this; + onOnQueryChange?: (event?: any) => any; /** * 点击清空按钮时触发 */ - $emit(eventName: 'on-clear'): this; + onOnClear?: (event?: any) => any; /** * 下拉框展开或收起时触发 */ - $emit(eventName: 'on-open-change'): this; + onOnOpenChange?: (event?: any) => any; /** * 新建条目时触发 */ - $emit(eventName: 'on-create'): this; + onOnCreate?: (event?: any) => any; /** * 选择项目时触发 */ - $emit(eventName: 'on-select'): this; + onOnSelect?: (event?: any) => any; /** * 配合 default-label 使用,详见示例 */ - $emit(eventName: 'on-set-default-options'): this; + onOnSetDefaultOptions?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 自定义 Select 内头部图标 */ - prefix: []; + prefix?: () => any; }; -} +}> -export declare class Option { +export declare const Option: DefineComponent<{ /** * 选项值,默认根据此属性值进行筛选,必填 */ - value: string | number; + value?: string | number; /** * 选项显示的内容,默认会读取 slot,无 slot 时,优先读取该 label 值,无 label 时,读取 value。当选中时,选择器会显示 label 为已选文案。大部分情况不需要配置此项,直接写入 slot 即可,在自定义选项时,该属性非常有用。 */ - label: string; + label?: string; /** * 是否禁用当前项 */ - disabled: boolean; + disabled?: boolean; /** * 设置后,在多选时,标签内容会优先显示设置的值 */ - tag: string | number; + tag?: string | number; -} +}> -export declare class OptionGroup { +export declare const OptionGroup: DefineComponent<{ /** * 分组的组名 */ - label: string; + label?: string; -} +}> diff --git a/types/skeleton.d.ts b/types/skeleton.d.ts index 80e982ea6..64fb675af 100644 --- a/types/skeleton.d.ts +++ b/types/skeleton.d.ts @@ -1,82 +1,84 @@ -export declare class Skeleton { +import type { DefineComponent } from 'vue'; + +export declare const Skeleton: DefineComponent<{ /** * 是否展示动画效果 */ - animated: boolean; + animated?: boolean; /** * 为 true 时,显示占位,反之则直接展示子组件 */ - loading: boolean; + loading?: boolean; /** * 为 true 时,段落显示圆角 */ - round: boolean; + round?: boolean; /** * 设置段落占位效果,为数字时,表示行数。另外,可以设置每行宽度,例如:`{ rows: 4, width: [100, 200, '300px', '50%'] }`,也可以为所有行设置相同宽度,例如:`{ rows: 4, width: 300 }` */ - paragraph: number | object; + paragraph?: number | object; /** * 是否显示标题占位,同时可以设置标题宽度,例如:`{ width: '100px' }` */ - title: boolean | object; + title?: boolean | object; /** * 是否显示头像占位,同时可以设置头像的类型和尺寸,例如:`{ type: 'square', size: 'large' }`,`type` 可选值有:`circle`、`square`,`size` 可选值有:`small`、`large`、`default` */ - avatar: boolean | object; + avatar?: boolean | object; - $slots: { + 'v-slots'?: { /** * 骨架屏消失后要渲染的内容 */ - default: []; + default?: () => any; /** * 自定义渲染骨架屏 */ - template: []; + template?: () => any; }; -} +}> -export declare class SkeletonItem { +export declare const SkeletonItem: DefineComponent<{ /** * 是否展示动画效果 */ - animated: boolean; + animated?: boolean; /** * 指定占位的类型,可选的值有:`circle`、`square`、`rect`、`image` */ - type: 'circle' | 'square' | 'rect' | 'image'; + type?: 'circle' | 'square' | 'rect' | 'image'; /** * 设置占位的尺寸,可选值有:`small`、`large`、`default` */ - size: 'small' | 'large' | 'default'; + size?: 'small' | 'large' | 'default'; /** * 设置占位的宽度,当 `type` 为 `rect` 或 `image` 时有效 */ - width: string | number; + width?: string | number; /** * 设置占位的高度,当 `type` 为 `rect` 或 `image` 时有效 */ - height: string | number; + height?: string | number; /** * 是否独占一行 */ - block: boolean; + block?: boolean; /** * 设置占位的背景图,当 `type` 为 `image` 时有效 */ - 'img-src': string; + 'img-src'?: string; -} +}> diff --git a/types/slider.d.ts b/types/slider.d.ts index 9502ecf49..6e054b3d5 100644 --- a/types/slider.d.ts +++ b/types/slider.d.ts @@ -1,77 +1,79 @@ -export declare class Slider { +import type { DefineComponent } from 'vue'; + +export declare const Slider: DefineComponent<{ /** * 滑块选定的值,可以使用 v-model 双向绑定数据。普通模式下,数据格式为数字,在双滑块模式下,数据格式为长度是2的数组,且每项都为数字 */ - 'model-value': number | []; + 'model-value'?: number | any[]; /** * 最小值 */ - min: number; + min?: number; /** * 最大值 */ - max: number; + max?: number; /** * 步长,取值建议能被(max - min)整除 */ - step: number; + step?: number; /** * 是否禁用滑块 */ - disabled: boolean; + disabled?: boolean; /** * 是否开启双滑块模式 */ - range: boolean; + range?: boolean; /** * 是否显示数字输入框,仅在单滑块模式下有效 */ - 'show-input': boolean; + 'show-input'?: boolean; /** * 是否显示间断点,建议在 step 不密集时使用 */ - 'show-stops': boolean; + 'show-stops'?: boolean; /** * 提示的显示控制,可选值为 `hover`(悬停,默认)、`always`(总是可见)、`never`(不可见) */ - 'show-tip': string; + 'show-tip'?: string; /** * Slider 会把当前值传给 `tip-format`,并在 Tooltip 中显示 tip-format 的返回值,若为 null,则隐藏 Tooltip */ - 'tip-format': Function; + 'tip-format'?: Function; /** * 数字输入框的尺寸,可选值为`large`、`small`、`default`或者不填,仅在开启 show-input 时有效 */ - 'input-size': '' | 'large' | 'small' | 'default'; + 'input-size'?: '' | 'large' | 'small' | 'default'; /** * 同 InputNumber 的 active-change */ - 'active-change': boolean; + 'active-change'?: boolean; /** * 标记, key 的类型必须为 number 且取值在闭区间 [min, max] 内,每个标记可以单独设置样式 */ - marks: object; + marks?: object; /** * 在松开滑动时触发,返回当前的选值,在滑动过程中不会触发 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; /** * 滑动条数据变化时触发,返回当前的选值,在滑动过程中实时触发 */ - $emit(eventName: 'on-input'): this; + onOnInput?: (event?: any) => any; -} +}> diff --git a/types/space.d.ts b/types/space.d.ts index 4edcce8e4..7388b0545 100644 --- a/types/space.d.ts +++ b/types/space.d.ts @@ -1,44 +1,46 @@ -export declare class Space { +import type { DefineComponent } from 'vue'; + +export declare const Space: DefineComponent<{ /** * 间距大小,当类型为 `String` 时,可选值有:`small`、`large`、`default` */ - size: 'small' | 'large' | 'default' | number | []; + size?: 'small' | 'large' | 'default' | number | []; /** * 布局方向,可选值有:`horizontal`、`vertical` */ - direction: 'horizontal' | 'vertical'; + direction?: 'horizontal' | 'vertical'; /** * 对齐方式,可选值有:`start`、`end`、`center`、`baseline`、`stretch` */ - align: 'start' | 'end' | 'center' | 'baseline' | 'stretch'; + align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch'; /** * 是否自动换行 */ - wrap: boolean; + wrap?: boolean; /** * 是否显示分隔符,值为 true 时显示默认的分隔符 */ - split: boolean; + split?: boolean; /** * Flex 布局类型,可选值有:`inline-flex`、`flex`,值为 `flex` 时,`align` 的默认值为 `stretch` */ - type: 'inline-flex' | 'flex'; + type?: 'inline-flex' | 'flex'; - $slots: { + 'v-slots'?: { /** * 需要添加间距的元素 */ - default: []; + default?: () => any; /** * 自定义分隔符 */ - split: []; + split?: () => any; }; -} +}> diff --git a/types/spin.d.ts b/types/spin.d.ts index b347499d4..36d8b0552 100644 --- a/types/spin.d.ts +++ b/types/spin.d.ts @@ -1,24 +1,26 @@ -export declare class Spin { +import type { DefineComponent } from 'vue'; + +export declare const Spin: DefineComponent<{ /** * 用于动画控制显/隐 */ - show: boolean; + show?: boolean; /** * Spin尺寸,可选值为`large`和`small`或者不设置 */ - size: '' | 'large' | 'small'; + size?: '' | 'large' | 'small'; /** * 是否固定,需要父级有`relative`或`absolute` */ - fix: boolean; + fix?: boolean; - $slots: { + 'v-slots'?: { /** * 自定义 Spin 的内容,设置slot后,默认的样式不生效 */ - '': []; + default?: () => any; }; -} +}> diff --git a/types/split.d.ts b/types/split.d.ts index 16e0bd1ba..5857d053b 100644 --- a/types/split.d.ts +++ b/types/split.d.ts @@ -1,64 +1,66 @@ -export declare class Split { +import type { DefineComponent } from 'vue'; + +export declare const Split: DefineComponent<{ /** * 面板位置,可以是 0~1 代表百分比,或具体数值的像素,可用 v-model 双向绑定 */ - 'model-value': number | string; + 'model-value'?: number | string; /** * 类型,可选值为 horizontal 或 vertical */ - mode: 'horizontal' | 'vertical'; + mode?: 'horizontal' | 'vertical'; /** * 最小阈值 */ - min: number | string; + min?: number | string; /** * 最大阈值 */ - max: number | string; + max?: number | string; /** * 拖拽开始 */ - $emit(eventName: 'on-move-start'): this; + onOnMoveStart?: (event?: any) => any; /** * 拖拽中 */ - $emit(eventName: 'on-moving'): this; + onOnMoving?: (event?: any) => any; /** * 拖拽结束 */ - $emit(eventName: 'on-move-end'): this; + onOnMoveEnd?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * mode 为 horizontal 时可用,左边面板 */ - left: []; + left?: () => any; /** * mode 为 horizontal 时可用,右边面板 */ - right: []; + right?: () => any; /** * mode 为 vertical 时可用,上边面板 */ - top: []; + top?: () => any; /** * mode 为 vertical 时可用,下边面板 */ - bottom: []; + bottom?: () => any; /** * 自定义分割拖拽节点 */ - trigger: []; + trigger?: () => any; }; -} +}> diff --git a/types/steps.d.ts b/types/steps.d.ts index 214a28168..6e8d96113 100644 --- a/types/steps.d.ts +++ b/types/steps.d.ts @@ -1,62 +1,64 @@ -export declare class Steps { +import type { DefineComponent } from 'vue'; + +export declare const Steps: DefineComponent<{ /** * 当前步骤,从 0 开始计数 */ - current: number; + current?: number; /** * 当前步骤的状态,可选值为`wait`、`process`、`finish`、`error` */ - status: 'wait' | 'process' | 'finish' | 'error'; + status?: 'wait' | 'process' | 'finish' | 'error'; /** * 步骤条的尺寸,可选值为`small`或者不写 */ - size: '' | 'small'; + size?: '' | 'small'; /** * 步骤条的方向,可选值为`horizontal`(水平)或`vertical`(垂直) */ - direction: 'horizontal' | 'vertical'; + direction?: 'horizontal' | 'vertical'; - $slots: { + 'v-slots'?: { /** * 自定义 title */ - title: []; + title?: () => any; /** * 自定义 content */ - content: []; + content?: () => any; /** * 自定义 icon */ - icon: []; + icon?: () => any; }; -} +}> -export declare class Step { +export declare const Step: DefineComponent<{ /** * 步骤的状态,可选值为`wait`、`process`、`finish`、`error`,不设置时自动判断 */ - status: string; + status?: string; /** * 标题 */ - title: string; + title?: string; /** * 步骤的详细描述,可选 */ - content: string; + content?: string; /** * 步骤的图标,可选 */ - icon: string; + icon?: string; -} +}> diff --git a/types/switch.d.ts b/types/switch.d.ts index cb89259bd..e0edbcaff 100644 --- a/types/switch.d.ts +++ b/types/switch.d.ts @@ -1,64 +1,66 @@ -export declare class Switch { +import type { DefineComponent } from 'vue'; + +export declare const Switch: DefineComponent<{ /** * 指定当前是否选中,可以使用 v-model 双向绑定数据 */ - 'model-value': boolean; + 'model-value'?: boolean; /** * 开关的尺寸,可选值为`large`、`small`、`default`或者不写。建议开关如果使用了2个汉字的文字,使用 large。 */ - size: '' | 'large' | 'small' | 'default'; + size?: '' | 'large' | 'small' | 'default'; /** * 禁用开关 */ - disabled: boolean; + disabled?: boolean; /** * 选中时的值,当使用类似 1 和 0 来判断是否选中时会很有用 */ - 'true-value': string | number | boolean; + 'true-value'?: string | number | boolean; /** * 没有选中时的值,当使用类似 1 和 0 来判断是否选中时会很有用 */ - 'false-value': string | number | boolean; + 'false-value'?: string | number | boolean; /** * 自定义打开时的背景色 */ - 'true-color': string; + 'true-color'?: string; /** * 自定义关闭时的背景色 */ - 'false-color': string; + 'false-color'?: string; /** * 返回 Promise 可以阻止切换 */ - 'before-change': Function; + 'before-change'?: Function; /** * 加载中的开关 */ - loading: boolean; + loading?: boolean; /** * 开关变化时触发,返回当前的状态 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 自定义显示打开时的内容 */ - open: []; + open?: () => any; /** * 自定义显示关闭时的内容 */ - close: []; + close?: () => any; }; -} +}> diff --git a/types/table-paste.d.ts b/types/table-paste.d.ts index e085d3302..385dd0be3 100644 --- a/types/table-paste.d.ts +++ b/types/table-paste.d.ts @@ -1,44 +1,46 @@ -export declare class TablePaste { +import type { DefineComponent } from 'vue'; + +export declare const TablePaste: DefineComponent<{ /** * 组件默认为左右结构,左边输入框,右边显示表格,如果想自定义输入框 (即使用 slot) 时,需设置该值 */ - value: string; + value?: string; /** * 是否隐藏右侧表格,开启后,只会显示输入框,这时用户可以根据事件自己渲染 Table */ - 'hide-table': boolean; + 'hide-table'?: boolean; /** * 代理的 Input props */ - 'input-props': object; + 'input-props'?: object; /** * 代理的 Table props */ - 'table-props': object; + 'table-props'?: object; /** * 输入框内容变化时触发,返回内容 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; /** * 表格渲染正确时触发,返回表格数据 tableData (含 columns 和 data) */ - $emit(eventName: 'on-success'): this; + onOnSuccess?: (event?: any) => any; /** * 表格渲染错误时触发,返回表格数据 tableData (含 columns 和 data) 及 错误行序号 errorIndex (从 1 计数) */ - $emit(eventName: 'on-error'): this; + onOnError?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 默认为普通输入框,如果想使用其它输入控件,比如 [codemirror](https://codemirror.net/) 或 [Ace](https://ace.c9.io/),可以自定义 slot,这时需传入 value 属性 */ - default: []; + default?: () => any; }; -} +}> diff --git a/types/table.d.ts b/types/table.d.ts index 6b8e56c81..fa5a7865f 100644 --- a/types/table.d.ts +++ b/types/table.d.ts @@ -1,397 +1,399 @@ -export declare class Table { +import type { DefineComponent } from 'vue'; + +export declare const Table: DefineComponent<{ /** * 显示的结构化数据,其中,字段 cellClassName 用于设置任意单元格的样式名称,因此数据不能使用该字段,详见示例**特定样式**。 */ - data: []; + data?: any[]; /** * 表格列的配置描述,具体项见后文 */ - columns: []; + columns?: any[]; /** * 是否显示间隔斑马纹 */ - stripe: boolean; + stripe?: boolean; /** * 是否显示纵向边框 */ - border: boolean; + border?: boolean; /** * 是否显示表头 */ - 'show-header': boolean; + 'show-header'?: boolean; /** * 表格宽度,单位 px */ - width: number | string; + width?: number | string; /** * 表格高度,单位 px,设置后,如果表格内容大于此值,会固定表头 */ - height: number | string; + height?: number | string; /** * 表格最大高度,单位 px,设置后,如果表格内容大于此值,会固定表头 */ - 'max-height': number | string; + 'max-height'?: number | string; /** * 表格是否加载中 */ - loading: boolean; + loading?: boolean; /** * 禁用鼠标悬停时的高亮 */ - 'disabled-hover': boolean; + 'disabled-hover'?: boolean; /** * 是否支持高亮选中的行,即单选 */ - 'highlight-row': boolean; + 'highlight-row'?: boolean; /** * 行的 className 的回调方法,传入参数:`row`:当前行数据 `index`:当前行的索引 */ - 'row-class-name': Function; + 'row-class-name'?: Function; /** * 表格尺寸,可选值为 `large`、`small`、`default` 或者不填 */ - size: string; + size?: string; /** * 数据为空时显示的提示内容 */ - 'no-data-text': string; + 'no-data-text'?: string; /** * 筛选数据为空时显示的提示内容 */ - 'no-filtered-data-text': string; + 'no-filtered-data-text'?: string; /** * 是否开启拖拽调整行顺序,需配合 @on-drag-drop 事件使用 */ - draggable: boolean; + draggable?: boolean; /** * 列使用 tooltip 时,配置它的主题,可选值为 dark 或 light */ - 'tooltip-theme': string; + 'tooltip-theme'?: string; /** * 列使用 tooltip 时,配置 Tooltip 的最大宽,默认是 300 */ - 'tooltip-max-width': number; + 'tooltip-max-width'?: number; /** * 是否强制使用内置的 row-key,开启后可能会影响性能 */ - 'row-key': boolean | string; + 'row-key'?: boolean | string; /** * 合并行或列的计算方法 */ - 'span-method': Function; + 'span-method'?: Function; /** * 是否在表尾显示合计行 */ - 'show-summary': boolean; + 'show-summary'?: boolean; /** * 合计行第一列的文本 */ - 'sum-text': string; + 'sum-text'?: string; /** * 自定义的合计计算方法 */ - 'summary-method': Function; + 'summary-method'?: Function; /** * 树形数据缩进宽度,单位 px */ - 'indent-size': number; + 'indent-size'?: number; /** * 异步加载树形数据的方法,详见示例 */ - 'load-data': Function; + 'load-data'?: Function; /** * 展开树形数据时,是否需要更新 `_showChildren` 字段,使用异步树形数据时建议开启 */ - 'update-show-children': boolean; + 'update-show-children'?: boolean; /** * 当前行点击右键是否会阻止默认行为 */ - 'context-menu': boolean; + 'context-menu'?: boolean; /** * 点击右键弹出菜单,需配合 slot `contextMenu` 一起使用,详见示例 */ - 'show-context-menu': boolean; + 'show-context-menu'?: boolean; /** * 列固定时,阴影显示规则,可选值为 `auto`、`show`、`hide` */ - 'fixed-shadow': string; + 'fixed-shadow'?: string; /** * 点击右键菜单项是否自动关闭右键菜单 */ - 'auto-close-contextmenu': boolean; + 'auto-close-contextmenu'?: boolean; /** * 开启 `highlight-row` 后有效,当表格的当前行发生变化的时候会触发 */ - $emit(eventName: 'on-current-change'): this; + onOnCurrentChange?: (event?: any) => any; /** * 在多选模式下有效,选中某一项时触发 */ - $emit(eventName: 'on-select'): this; + onOnSelect?: (event?: any) => any; /** * 在多选模式下有效,取消选中某一项时触发 */ - $emit(eventName: 'on-select-cancel'): this; + onOnSelectCancel?: (event?: any) => any; /** * 在多选模式下有效,点击全选时触发 */ - $emit(eventName: 'on-select-all'): this; + onOnSelectAll?: (event?: any) => any; /** * 在多选模式下有效,点击取消全选时触发 */ - $emit(eventName: 'on-select-all-cancel'): this; + onOnSelectAllCancel?: (event?: any) => any; /** * 在多选模式下有效,只要选中项发生变化时就会触发 */ - $emit(eventName: 'on-selection-change'): this; + onOnSelectionChange?: (event?: any) => any; /** * 排序时有效,当点击排序时触发 */ - $emit(eventName: 'on-sort-change'): this; + onOnSortChange?: (event?: any) => any; /** * 筛选时有效,筛选条件发生变化时触发 */ - $emit(eventName: 'on-filter-change'): this; + onOnFilterChange?: (event?: any) => any; /** * 单击某一行时触发 */ - $emit(eventName: 'on-row-click'): this; + onOnRowClick?: (event?: any) => any; /** * 双击某一行时触发 */ - $emit(eventName: 'on-row-dblclick'): this; + onOnRowDblclick?: (event?: any) => any; /** * 点击单元格时触发 */ - $emit(eventName: 'on-cell-click'): this; + onOnCellClick?: (event?: any) => any; /** * 展开或收起某一行时触发 */ - $emit(eventName: 'on-expand'): this; + onOnExpand?: (event?: any) => any; /** * 拖拽排序松开时触发,返回置换的两行数据索引 */ - $emit(eventName: 'on-drag-drop'): this; + onOnDragDrop?: (event?: any) => any; /** * 拖拽调整列宽时触发 */ - $emit(eventName: 'on-column-width-resize'): this; + onOnColumnWidthResize?: (event?: any) => any; /** * 当前行点击右键时触发 */ - $emit(eventName: 'on-contextmenu'): this; + onOnContextmenu?: (event?: any) => any; /** * 展开或收起子数据时触发 */ - $emit(eventName: 'on-expand-tree'): this; + onOnExpandTree?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 表头 */ - header: []; + header?: () => any; /** * 页脚 */ - footer: []; + footer?: () => any; /** * 加载中 */ - loading: []; + loading?: () => any; /** * 右键菜单,详见示例 */ - contextMenu: []; + contextMenu?: () => any; }; -} +}> -export declare class TableColumn { +export declare const TableColumnConfig: { /** * 列类型,可选值为 index、selection、expand、html */ - type: 'index' | 'selection' | 'expand' | 'html'; + type?: 'index' | 'selection' | 'expand' | 'html'; /** * 列头显示文字 */ - title: string; + title?: string; /** * 对应列内容的字段名 */ - key: string; + key?: string; /** * 列宽 */ - width: number; + width?: number; /** * 最小列宽 */ - minWidth: number; + minWidth?: number; /** * 最大列宽 */ - maxWidth: number; + maxWidth?: number; /** * 对齐方式,可选值为 `left` 左对齐、`right` 右对齐和 `center` 居中对齐 */ - align: 'left' | 'right' | 'center'; + align?: 'left' | 'right' | 'center'; /** * 列的样式名称 */ - className: string; + className?: string; /** * 列是否固定在左侧或者右侧,可选值为 `left` 左侧和 `right` 右侧 */ - fixed: 'left' | 'right'; + fixed?: 'left' | 'right'; /** * 开启后,文本将不换行,超出部分显示为省略号 */ - ellipsis: boolean; + ellipsis?: boolean; /** * 开启后,文本将不换行,超出部分显示为省略号,并用 Tooltip 组件显示完整内容 */ - tooltip: boolean; + tooltip?: boolean; /** * 配置 Tooltip 的主题,可选值为 dark 或 light */ - tooltipTheme: string; + tooltipTheme?: string; /** * 配置 Tooltip 的最大宽,默认是 300 */ - tooltipMaxWidth: number; + tooltipMaxWidth?: number; /** * 自定义渲染列,使用 Vue 的 Render 函数。传入两个参数,第一个是 h,第二个为对象,包含 row、column 和 index,分别指当前行数据,当前列数据,当前行索引,详见示例。 */ - render: Function; + render?: Function; /** * 自定义列头显示内容,使用 Vue 的 Render 函数。传入两个参数,第一个是 h,第二个为对象,包含 `column` 和 `index`,分别为当前列数据和当前列索引。 */ - renderHeader: Function; + renderHeader?: Function; /** * type 为 index 时可用,自定义序号 */ - indexMethod: Function; + indexMethod?: Function; /** * 对应列是否可以排序,如果设置为 `custom`,则代表用户希望远程排序,需要监听 Table 的 on-sort-change 事件 */ - sortable: boolean | 'custom'; + sortable?: boolean | 'custom'; /** * 自定义排序使用的方法,接收三个参数 a 、 b 和 type,当设置 `sortable: true` 时有效。type 值为 asc 和 desc */ - sortMethod: Function; + sortMethod?: Function; /** * 设置初始化排序。值为 asc 和 desc */ - sortType: 'asc' | 'desc'; + sortType?: 'asc' | 'desc'; /** * 过滤数据的选项,格式为数组,数组中每项包含 `label` 和 `value` 属性,使用过滤,必须同时配置 filterMethod */ - filters: []; + filters?: any[]; /** * 数据过滤使用的方法,如果是多选的筛选项,对每一条数据会执行多次,任意一次返回 true 就会显示 */ - filterMethod: Function; + filterMethod?: Function; /** * 数据过滤的选项是否多选 */ - filterMultiple: boolean; + filterMultiple?: boolean; /** * 在初始化时使用过滤,数组,值为需要过滤的 value 集合 */ - filteredValue: []; + filteredValue?: any[]; /** * 使用远程过滤 */ - filterRemote: Function; + filterRemote?: Function; /** * 表头分组 */ - children: []; + children?: any[]; /** * 该列是否允许拖拽调整宽度,需开启 border 属性,且设置 width */ - resizable: boolean; + resizable?: boolean; /** * 指定该列为显示展开/收起图标,树形数据时使用 */ - tree: boolean; + tree?: boolean; /** * 使用 slot 自定义列时,列的渲染模式。可选值为 block、inline、inline-block,当使用树形数据时,建议使用 inline 或 inline-block */ - display: string; + display?: string; } diff --git a/types/tabs.d.ts b/types/tabs.d.ts index d696e0c7c..e63fcc76d 100644 --- a/types/tabs.d.ts +++ b/types/tabs.d.ts @@ -1,127 +1,129 @@ -export declare class Tabs { +import type { DefineComponent } from 'vue'; + +export declare const Tabs: DefineComponent<{ /** * 当前激活 tab 面板的 name,可以使用 v-model 双向绑定数据 */ - 'model-value': string; + 'model-value'?: string; /** * 页签的基本样式,可选值为 `line` 和 `card` */ - type: 'line' | 'card'; + type?: 'line' | 'card'; /** * 尺寸,可选值为 `default` 和 `small`,仅在 `type="line"` 时有效 */ - size: 'default' | 'small'; + size?: 'default' | 'small'; /** * 是否可以关闭页签,仅在 `type="card"` 时有效 */ - closable: boolean; + closable?: boolean; /** * 是否使用 CSS3 动画 */ - animated: boolean; + animated?: boolean; /** * Tabs 内的表单类组件是否自动获得焦点 */ - 'capture-focus': boolean; + 'capture-focus'?: boolean; /** * 关闭前的函数,返回 Promise 可阻止标签关闭 */ - 'before-remove': Function; + 'before-remove'?: Function; /** * 当嵌套使用 Tabs,指定 name 区分层级 */ - name: string; + name?: string; /** * 开启可配合事件 @on-drag-drop 实现拖拽调整页签顺序,详见示例 */ - draggable: boolean; + draggable?: boolean; /** * 点击右键菜单项是否自动关闭右键菜单 */ - 'auto-close-contextmenu': boolean; + 'auto-close-contextmenu'?: boolean; /** * tab 被点击时触发 */ - $emit(eventName: 'on-click'): this; + onOnClick?: (event?: any) => any; /** * tab 被关闭时触发 */ - $emit(eventName: 'on-tab-remove'): this; + onOnTabRemove?: (event?: any) => any; /** * 当前页签点击右键时触发 */ - $emit(eventName: 'on-contextmenu'): this; + onOnContextmenu?: (event?: any) => any; /** * 拖拽调整页签顺序时触发 */ - $emit(eventName: 'on-drag-drop'): this; + onOnDragDrop?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 附加内容 */ - extra: []; + extra?: () => any; /** * 右键菜单,详见示例 */ - contextMenu: []; + contextMenu?: () => any; }; -} +}> -export declare class TabPane { +export declare const TabPane: DefineComponent<{ /** * 用于标识当前面板,对应 value,默认为其索引值 */ - name: string; + name?: string; /** * 选项卡头显示文字,支持 Render 函数。 */ - label: string | Function; + label?: string | Function; /** * 选项卡图标 */ - icon: string; + icon?: string; /** * 是否禁用该选项卡 */ - disabled: boolean; + disabled?: boolean; /** * 是否可以关闭页签,仅在 `type="card"` 时有效 */ - closable: boolean; + closable?: boolean; /** * 当嵌套使用 Tabs,设置该属性指向对应 Tabs 的 name 字段 */ - tab: string; + tab?: string; /** * 在 TabPane 使用 v-if 时,并不会按照预先的顺序渲染,这时可设置 index,并从小到大排序(需大于 0) */ - index: number; + index?: number; /** * 是否支持右键菜单 */ - 'context-menu': boolean; + 'context-menu'?: boolean; -} +}> diff --git a/types/tag-select.d.ts b/types/tag-select.d.ts index 66183a89c..c1be5c18b 100644 --- a/types/tag-select.d.ts +++ b/types/tag-select.d.ts @@ -1,45 +1,47 @@ -export declare class TagSelect { +import type { DefineComponent } from 'vue'; + +export declare const TagSelect: DefineComponent<{ /** * 指定选中项目的 value 值,可以使用 v-model 双向绑定数据。 */ - 'model-value': []; + 'model-value'?: any[]; /** * 是否显示 `展开/收起` 按钮 */ - expandable: boolean; + expandable?: boolean; /** * 隐藏 `全部` 按钮 */ - 'hide-check-all': boolean; + 'hide-check-all'?: boolean; /** * 文案配置 */ - locale: object; + locale?: object; /** * 选项变化时触发,返回已选项 name 集合和当前项 name */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; /** * 全选状态变化时触发,返回全选状态 */ - $emit(eventName: 'on-checked-all'): this; + onOnCheckedAll?: (event?: any) => any; -} +}> -export declare class TagSelectOption { +export declare const TagSelectOption: DefineComponent<{ /** * 标签 name,必填 */ - name: string | number; + name?: string | number; /** * Tag 的颜色,同 View UI Plus Tag 组件的 color */ - color: string; + color?: string; -} +}> diff --git a/types/tag.d.ts b/types/tag.d.ts index 34a9cc8b5..342263f4d 100644 --- a/types/tag.d.ts +++ b/types/tag.d.ts @@ -1,47 +1,49 @@ -export declare class Tag { +import type { DefineComponent } from 'vue'; + +export declare const Tag: DefineComponent<{ /** * 标签是否可以关闭 */ - closable: boolean; + closable?: boolean; /** * 标签是否可以选择 */ - checkable: boolean; + checkable?: boolean; /** * 标签的选中状态 */ - checked: boolean; + checked?: boolean; /** * 标签的样式类型,可选值为 `border`、`dot`或不填 */ - type: '' | 'border' | 'dot'; + type?: '' | 'border' | 'dot'; /** * 标签颜色,预设颜色值为`default`、`primary`、`success`、`warning`、`error`、`blue`、`green`、`red`、`yellow`、`pink`、`magenta`、`volcano`、`orange`、`gold`、`lime`、`cyan`、`geekblue`、`purple`,你也可以自定义颜色值。 */ - color: 'default' | 'primary' | 'success' | 'warning' | 'error' | 'blue' | 'green' | 'red' | 'yellow' | 'pink' | 'magenta' | 'volcano' | 'orange' | 'gold' | 'lime' | 'cyan' | 'geekblue' | 'purple'; + color?: 'default' | 'primary' | 'success' | 'warning' | 'error' | 'blue' | 'green' | 'red' | 'yellow' | 'pink' | 'magenta' | 'volcano' | 'orange' | 'gold' | 'lime' | 'cyan' | 'geekblue' | 'purple'; /** * 当前标签的名称,使用 v-for,并支持关闭时,会比较有用 */ - name: string | number; + name?: string | number; /** * 尺寸,可选值为 large、medium、default */ - size: string; + size?: string; /** * 关闭时触发 */ - $emit(eventName: 'on-close'): this; + onOnClose?: (event?: any) => any; /** * 切换选中状态时触发 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; -} +}> diff --git a/types/time-picker.d.ts b/types/time-picker.d.ts index 8add5b744..73c3a7ea8 100644 --- a/types/time-picker.d.ts +++ b/types/time-picker.d.ts @@ -1,124 +1,126 @@ -export declare class TimePicker { +import type { DefineComponent } from 'vue'; + +export declare const TimePicker: DefineComponent<{ /** * 显示类型,可选值为 `time`、`timerange` */ - type: 'time' | 'timerange'; + type?: 'time' | 'timerange'; /** * 时间,可以是 JavaScript 的 Date,例如 **new Date()** ,也可以是标准的时间格式,注意:model-value 使用 v-model 时,值是 Date 类型,可以配合 @on-change 使用 */ - 'model-value': Date; + 'model-value'?: Date; /** * 展示的时间格式 */ - format: Date; + format?: Date; /** * 下拉列表的时间间隔,数组的三项分别对应小时、分钟、秒。例如设置为 [1, 15] 时,分钟会显示:00、15、30、45。 */ - steps: []; + steps?: any[]; /** * 时间选择器出现的位置,可选值为`top` `top-start` `top-end` `bottom` `bottom-start` `bottom-end` `left` `left-start` `left-end` `right` `right-start` `right-end` */ - placement: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; + placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; /** * 占位文本 */ - placeholder: string; + placeholder?: string; /** * 是否显示底部控制栏 */ - confirm: boolean; + confirm?: boolean; /** * 手动控制时间选择器的显示状态,true 为显示,false 为收起。使用该属性后,选择器不会主动关闭。建议配合 slot 及 confirm 和相关事件一起使用 */ - open: boolean; + open?: boolean; /** * 尺寸,可选值为`large`、`small`、`default`或者不设置 */ - size: '' | 'large' | 'small' | 'default'; + size?: '' | 'large' | 'small' | 'default'; /** * 是否禁用选择器 */ - disabled: boolean; + disabled?: boolean; /** * 是否显示清除按钮 */ - clearable: boolean; + clearable?: boolean; /** * 完全只读,开启后不会弹出选择器,只在没有设置 open 属性下生效 */ - readonly: boolean; + readonly?: boolean; /** * 文本框是否可以输入,只在没有使用 slot 时有效 */ - editable: boolean; + editable?: boolean; /** * 是否将弹层放置于 body 内,在 Tabs、带有 fixed 的 Table 列内使用时,建议添加此属性,它将不受父级样式影响,从而达到更好的效果 */ - transfer: boolean; + transfer?: boolean; /** * 给表单元素设置 `id`,详见 Form 用法。 */ - 'element-id': string; + 'element-id'?: string; /** * 两个日期间的分隔符 */ - separator: string; + separator?: string; /** * 是否开启 capture 模式,也可通过全局配置 */ - capture: boolean; + capture?: boolean; /** * 开启 transfer 时,给浮层添加额外的 class 名称 */ - 'transfer-class-name': string; + 'transfer-class-name'?: string; /** * 是否开启 Popper 的 eventsEnabled 属性,开启可能会牺牲一定的性能 */ - 'events-enabled': boolean; + 'events-enabled'?: boolean; /** * 时间发生变化时触发 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; /** * 弹出浮层和关闭浮层时触发 */ - $emit(eventName: 'on-open-change'): this; + onOnOpenChange?: (event?: any) => any; /** * 点击确定按钮时触发 */ - $emit(eventName: 'on-ok'): this; + onOnOk?: (event?: any) => any; /** * 在清空日期时触发 */ - $emit(eventName: 'on-clear'): this; + onOnClear?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 自定义选择器的显示内容,建议与 open 等参数一起使用,详见示例 */ - '': []; + default?: () => any; }; -} +}> diff --git a/types/time.d.ts b/types/time.d.ts index aba1409ed..9a47c1415 100644 --- a/types/time.d.ts +++ b/types/time.d.ts @@ -1,22 +1,24 @@ -export declare class Time { +import type { DefineComponent } from 'vue'; + +export declare const Time: DefineComponent<{ /** * 需要对比的时间,可以是时间戳或 Date 类型 */ - time: number | Date | string; + time?: number | Date | string; /** * 类型,可选值为 relative、date 或 datetime */ - type: 'relative' | 'date' | 'datetime'; + type?: 'relative' | 'date' | 'datetime'; /** * 自动更新的间隔,单位:秒 */ - interval: number; + interval?: number; /** * 填写该值,点击会定位锚点 */ - hash: string; + hash?: string; -} +}> diff --git a/types/timeline.d.ts b/types/timeline.d.ts index f828ecb6b..a0ac4475b 100644 --- a/types/timeline.d.ts +++ b/types/timeline.d.ts @@ -1,27 +1,29 @@ -export declare class Timeline { +import type { DefineComponent } from 'vue'; + +export declare const Timeline: DefineComponent<{ /** * 指定是否最后一个节点为幽灵节点 */ - pending: boolean; + pending?: boolean; -} +}> -export declare class TimelineItem { +export declare const TimelineItem: DefineComponent<{ /** * 圆圈颜色,可选值为`blue`、`red`、`green`,或自定义色值 */ - color: 'blue' | 'red' | 'green' | string; + color?: 'blue' | 'red' | 'green' | string; - $slots: { + 'v-slots'?: { /** * 自定义时间轴点内容 */ - dot: []; + dot?: () => any; /** * 基本内容 */ - '': []; + default?: () => any; }; -} +}> diff --git a/types/tooltip.d.ts b/types/tooltip.d.ts index b48eacb55..d2bf61829 100644 --- a/types/tooltip.d.ts +++ b/types/tooltip.d.ts @@ -1,84 +1,86 @@ -export declare class Tooltip { +import type { DefineComponent } from 'vue'; + +export declare const Tooltip: DefineComponent<{ /** * 显示的内容 */ - content: string | number; + content?: string | number; /** * 提示框出现的位置,可选值为`top``top-start``top-end``bottom``bottom-start``bottom-end``left``left-start``left-end``right``right-start``right-end`,2.12.0 版本开始支持自动识别 */ - placement: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; + placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; /** * 是否禁用提示框 */ - disabled: boolean; + disabled?: boolean; /** * 延迟显示,单位毫秒 */ - delay: number; + delay?: number; /** * 是否总是可见 */ - always: boolean; + always?: boolean; /** * 主题,可选值为 dark 或 light */ - theme: string; + theme?: string; /** * 最大宽度,超出最大值后,文本将自动换行,并两端对齐 */ - 'max-width': string | number; + 'max-width'?: string | number; /** * 出现位置的偏移量 */ - offset: number; + offset?: number; /** * 是否将弹层放置于 body 内,在 Tabs、带有 fixed 的 Table 列内使用时,建议添加此属性,它将不受父级样式影响,从而达到更好的效果 */ - transfer: boolean; + transfer?: boolean; /** * 自定义 popper.js 的配置项,具体配置见 [popper.js 文档](https://popper.js.org/popper-documentation.html) */ - options: object; + options?: object; /** * 开启 transfer 时,给浮层添加额外的 class 名称 */ - 'transfer-class-name': string; + 'transfer-class-name'?: string; /** * 是否开启 Popper 的 eventsEnabled 属性,开启可能会牺牲一定的性能 */ - 'events-enabled': boolean; + 'events-enabled'?: boolean; /** * 在提示框显示时触发 */ - $emit(eventName: 'on-popper-show'): this; + onOnPopperShow?: (event?: any) => any; /** * 在提示框消失时触发 */ - $emit(eventName: 'on-popper-hide'): this; + onOnPopperHide?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 主体内容 */ - '': []; + default?: () => any; /** * 提示框的内容,定义此 slot 时,会覆盖 props `content`。 */ - content: []; + content?: () => any; }; -} +}> diff --git a/types/transfer.d.ts b/types/transfer.d.ts index 5ff34ada0..2b456ad6d 100644 --- a/types/transfer.d.ts +++ b/types/transfer.d.ts @@ -1,79 +1,81 @@ -export declare class Transfer { +import type { DefineComponent } from 'vue'; + +export declare const Transfer: DefineComponent<{ /** * 数据源,其中的数据将会被渲染到左边一栏中,`targetKeys` 中指定的除外。 */ - data: []; + data?: any[]; /** * 显示在右侧框数据的key集合 */ - 'target-keys': []; + 'target-keys'?: any[]; /** * 每行数据渲染函数,该函数的入参为 `data` 中的项 */ - 'render-format': Function; + 'render-format'?: Function; /** * 设置哪些项应该被选中 */ - 'selected-keys': []; + 'selected-keys'?: any[]; /** * 两个穿梭框的自定义样式 */ - 'list-style': object; + 'list-style'?: object; /** * 标题集合,顺序从左至右 */ - titles: []; + titles?: any[]; /** * 操作文案集合,顺序从上至下 */ - operations: []; + operations?: any[]; /** * 是否颠倒两个操作按钮的上下顺序 */ - 'reverse-operation': boolean; + 'reverse-operation'?: boolean; /** * 是否显示搜索框 */ - filterable: boolean; + filterable?: boolean; /** * 搜索框的占位 */ - 'filter-placeholder': string; + 'filter-placeholder'?: string; /** * 自定义搜索函数,入参为 data 和 query,data 为项,query 为当前输入的搜索词 */ - 'filter-method': Function; + 'filter-method'?: Function; /** * 当列表为空时显示的内容 */ - 'not-found-text': string; + 'not-found-text'?: string; /** * 选项在两栏之间转移时的回调函数 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; /** * 选中项发生变化时触发 */ - $emit(eventName: 'on-selected-change'): this; + onOnSelectedChange?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 自定义底部内容 */ - '': []; + default?: () => any; }; -} +}> diff --git a/types/tree-select.d.ts b/types/tree-select.d.ts index 4a00d7cc4..0ab1536a2 100644 --- a/types/tree-select.d.ts +++ b/types/tree-select.d.ts @@ -1,42 +1,44 @@ -export declare class TreeSelect { +import type { DefineComponent } from 'vue'; + +export declare const TreeSelect: DefineComponent<{ /** * 指定选中项目的 value 值,可以使用 v-model 双向绑定数据。单选时只接受 String 或 Number,多选时只接受 Array */ - 'model-value': string | number | []; + 'model-value'?: string | number | any[]; /** * Tree 的数据,基本同 View UI Plus Tree,但要额外设置一个 `value` 字段,而且 `selected` 和 `checked` 字段需预先设置在 data 中,详见示例 */ - data: []; + data?: any[]; /** * 是否支持多选 */ - multiple: boolean; + multiple?: boolean; /** * 是否显示多选框 */ - 'show-checkbox': boolean; + 'show-checkbox'?: boolean; /** * 异步加载数据的方法,详见示例 */ - 'load-data': Function; + 'load-data'?: Function; /** * 是否将弹层放置于 body 内 */ - transfer: boolean; + transfer?: boolean; /** * 选项变化时触发 */ - $emit(eventName: 'on-change'): this; + onOnChange?: (event?: any) => any; /** * 下拉框展开或收起时触发 */ - $emit(eventName: 'on-open-change'): this; + onOnOpenChange?: (event?: any) => any; -} +}> diff --git a/types/tree.d.ts b/types/tree.d.ts index a61cc2567..12f307037 100644 --- a/types/tree.d.ts +++ b/types/tree.d.ts @@ -1,137 +1,139 @@ -export declare class Tree { +import type { DefineComponent } from 'vue'; + +export declare const Tree: DefineComponent<{ /** * 可嵌套的节点属性的数组,生成 tree 的数据 */ - data: []; + data?: any[]; /** * 是否支持多选 */ - multiple: boolean; + multiple?: boolean; /** * 是否显示多选框 */ - 'show-checkbox': boolean; + 'show-checkbox'?: boolean; /** * 没有数据时的提示 */ - 'empty-text': string; + 'empty-text'?: string; /** * 异步加载数据的方法,见示例 */ - 'load-data': Function; + 'load-data'?: Function; /** * 自定义渲染内容,见示例 */ - render: Function; + render?: Function; /** * 定义子节点键 */ - 'children-key': string; + 'children-key'?: string; /** * 在显示复选框的情况下,是否严格的遵循父子不互相关联的做法 */ - 'check-strictly': boolean; + 'check-strictly'?: boolean; /** * 开启后,在 show-checkbox 模式下,select 的交互也将转为 check */ - 'check-directly': boolean; + 'check-directly'?: boolean; /** * 开启后,点击节点将使用单选效果 */ - 'select-node': boolean; + 'select-node'?: boolean; /** * 开启后,点击节点将使用展开/收起子节点效果,该选项优先于 select-node */ - 'expand-node': boolean; + 'expand-node'?: boolean; /** * 点击右键菜单项是否自动关闭右键菜单 */ - 'auto-close-contextmenu': boolean; + 'auto-close-contextmenu'?: boolean; /** * 点击树节点时触发 */ - $emit(eventName: 'on-select-change'): this; + onOnSelectChange?: (event?: any) => any; /** * 点击复选框时触发 */ - $emit(eventName: 'on-check-change'): this; + onOnCheckChange?: (event?: any) => any; /** * 展开和收起子列表时触发 */ - $emit(eventName: 'on-toggle-expand'): this; + onOnToggleExpand?: (event?: any) => any; /** * 当前节点点击右键时触发 */ - $emit(eventName: 'on-contextmenu'): this; + onOnContextmenu?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 右键菜单,详见示例 */ - contextMenu: []; + contextMenu?: () => any; }; -} +}> -export declare class TreeChild { +export declare const TreeChildConfig: { /** * 标题 */ - title: string | Element; + title?: string | Element; /** * 是否展开直子节点 */ - expand: boolean; + expand?: boolean; /** * 禁掉响应 */ - disabled: boolean; + disabled?: boolean; /** * 禁掉 checkbox */ - disableCheckbox: boolean; + disableCheckbox?: boolean; /** * 是否选中子节点 */ - selected: boolean; + selected?: boolean; /** * 是否勾选(如果勾选,子节点也会全部勾选) */ - checked: boolean; + checked?: boolean; /** * 子节点属性数组 */ - children: []; + children?: any[]; /** * 自定义当前节点渲染内容,见示例 */ - render: Function; + render?: Function; /** * 是否支持右键菜单 */ - contextmenu: boolean; + contextmenu?: boolean; } diff --git a/types/trend.d.ts b/types/trend.d.ts index 4eb4c0228..a432554ef 100644 --- a/types/trend.d.ts +++ b/types/trend.d.ts @@ -1,22 +1,24 @@ -export declare class Trend { +import type { DefineComponent } from 'vue'; + +export declare const Trend: DefineComponent<{ /** * 上升下降标识,可选值为 up 或 down */ - flag: string; + flag?: string; /** * 是否以彩色显示 */ - colorful: boolean; + colorful?: boolean; /** * 是否颜色反转 */ - 'reverse-color': boolean; + 'reverse-color'?: boolean; /** * 文字是否显示颜色(受 colorful 和 reverse-color 的影响) */ - 'text-color': boolean; + 'text-color'?: boolean; -} +}> diff --git a/types/typography.d.ts b/types/typography.d.ts index 413195152..152392e35 100644 --- a/types/typography.d.ts +++ b/types/typography.d.ts @@ -1,728 +1,730 @@ -export declare class Title { +import type { DefineComponent } from 'vue'; + +export declare const Title: DefineComponent<{ /** * 重要程度,相当于 `h1`、`h2`、`h3`、`h4`、`h5` */ - level: 1 | 2 | 3 | 4 | 5; + level?: 1 | 2 | 3 | 4 | 5; /** * 绑定的值,可使用 v-model 双向绑定 */ - 'model-value': string; + 'model-value'?: string; /** * 文本类型,可选值为 `secondary`、`success`、`warning`、`danger` */ - type: '' | 'secondary' | 'success' | 'warning' | 'danger'; + type?: '' | 'secondary' | 'success' | 'warning' | 'danger'; /** * 是否可以拷贝 */ - copyable: boolean; + copyable?: boolean; /** * 自定义拷贝内容 */ - 'copy-text': string; + 'copy-text'?: string; /** * 拷贝配置项,支持全局配置 */ - 'copy-config': object; + 'copy-config'?: object; /** * 是否可以编辑 */ - editable: boolean; + editable?: boolean; /** * 编辑配置项,支持全局配置 */ - 'edit-config': object; + 'edit-config'?: object; /** * 自动溢出省略 */ - ellipsis: boolean; + ellipsis?: boolean; /** * 自动溢出省略配置项,支持全局配置 */ - 'ellipsis-config': object; + 'ellipsis-config'?: object; /** * 禁用文本 */ - disabled: boolean; + disabled?: boolean; /** * 添加代码样式 */ - code: boolean; + code?: boolean; /** * 添加删除线样式 */ - delete: boolean; + delete?: boolean; /** * 添加键盘样式 */ - keyboard: boolean; + keyboard?: boolean; /** * 添加标记样式 */ - mark: boolean; + mark?: boolean; /** * 添加下划线样式 */ - underline: boolean; + underline?: boolean; /** * 是否加粗 */ - strong: boolean; + strong?: boolean; /** * 是否斜体 */ - italic: boolean; + italic?: boolean; /** * 是否开启 Tooltip 的 transfer 属性,仅适用于 ellipsis 模式 */ - transfer: boolean; + transfer?: boolean; /** * Tooltip 的 theme 属性,仅适用于 ellipsis 模式 */ - theme: 'dark' | 'light'; + theme?: 'dark' | 'light'; /** * Tooltip 的 max-width 属性,仅适用于 ellipsis 模式 */ - 'max-width': number | string; + 'max-width'?: number | string; /** * Tooltip 的 placement 属性,仅适用于 ellipsis 模式 */ - placement: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; + placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; /** * 拷贝成功时触发 */ - $emit(eventName: 'on-copy-success'): this; + onOnCopySuccess?: (event?: any) => any; /** * 拷贝失败时触发 */ - $emit(eventName: 'on-copy-error'): this; + onOnCopyError?: (event?: any) => any; /** * 进入编辑状态时触发 */ - $emit(eventName: 'on-edit-start'): this; + onOnEditStart?: (event?: any) => any; /** * 结束编辑状态时触发,即保存 */ - $emit(eventName: 'on-edit-end'): this; + onOnEditEnd?: (event?: any) => any; /** * 编辑内容时触发 */ - $emit(eventName: 'on-edit-change'): this; + onOnEditChange?: (event?: any) => any; /** * 退出编辑时触发 */ - $emit(eventName: 'on-edit-cancel'): this; + onOnEditCancel?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 文本内容,优先级低于 model-value */ - default: []; + default?: () => any; /** * 自定义拷贝图标,可选参数 copied */ - copyIcon: []; + copyIcon?: () => any; /** * 自定义编辑图标 */ - editIcon: []; + editIcon?: () => any; /** * 自定义回车图标 */ - enterIcon: []; + enterIcon?: () => any; }; -} +}> -export declare class Text { +export declare const Text: DefineComponent<{ /** * 绑定的值,可使用 v-model 双向绑定 */ - 'model-value': string; + 'model-value'?: string; /** * 文本类型,可选值为 `secondary`、`success`、`warning`、`danger` */ - type: '' | 'secondary' | 'success' | 'warning' | 'danger'; + type?: '' | 'secondary' | 'success' | 'warning' | 'danger'; /** * 是否可以拷贝 */ - copyable: boolean; + copyable?: boolean; /** * 自定义拷贝内容 */ - 'copy-text': string; + 'copy-text'?: string; /** * 拷贝配置项,支持全局配置 */ - 'copy-config': object; + 'copy-config'?: object; /** * 是否可以编辑 */ - editable: boolean; + editable?: boolean; /** * 编辑配置项,支持全局配置 */ - 'edit-config': object; + 'edit-config'?: object; /** * 自动溢出省略 */ - ellipsis: boolean; + ellipsis?: boolean; /** * 自动溢出省略配置项,支持全局配置 */ - 'ellipsis-config': object; + 'ellipsis-config'?: object; /** * 禁用文本 */ - disabled: boolean; + disabled?: boolean; /** * 添加代码样式 */ - code: boolean; + code?: boolean; /** * 添加删除线样式 */ - delete: boolean; + delete?: boolean; /** * 添加键盘样式 */ - keyboard: boolean; + keyboard?: boolean; /** * 添加标记样式 */ - mark: boolean; + mark?: boolean; /** * 添加下划线样式 */ - underline: boolean; + underline?: boolean; /** * 是否加粗 */ - strong: boolean; + strong?: boolean; /** * 是否斜体 */ - italic: boolean; + italic?: boolean; /** * 是否开启 Tooltip 的 transfer 属性,仅适用于 ellipsis 模式 */ - transfer: boolean; + transfer?: boolean; /** * Tooltip 的 theme 属性,仅适用于 ellipsis 模式 */ - theme: 'dark' | 'light'; + theme?: 'dark' | 'light'; /** * Tooltip 的 max-width 属性,仅适用于 ellipsis 模式 */ - 'max-width': number | string; + 'max-width'?: number | string; /** * Tooltip 的 placement 属性,仅适用于 ellipsis 模式 */ - placement: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; + placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; /** * 拷贝成功时触发 */ - $emit(eventName: 'on-copy-success'): this; + onOnCopySuccess?: (event?: any) => any; /** * 拷贝失败时触发 */ - $emit(eventName: 'on-copy-error'): this; + onOnCopyError?: (event?: any) => any; /** * 进入编辑状态时触发 */ - $emit(eventName: 'on-edit-start'): this; + onOnEditStart?: (event?: any) => any; /** * 结束编辑状态时触发,即保存 */ - $emit(eventName: 'on-edit-end'): this; + onOnEditEnd?: (event?: any) => any; /** * 编辑内容时触发 */ - $emit(eventName: 'on-edit-change'): this; + onOnEditChange?: (event?: any) => any; /** * 退出编辑时触发 */ - $emit(eventName: 'on-edit-cancel'): this; + onOnEditCancel?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 文本内容,优先级低于 model-value */ - default: []; + default?: () => any; /** * 自定义拷贝图标,可选参数 copied */ - copyIcon: []; + copyIcon?: () => any; /** * 自定义编辑图标 */ - editIcon: []; + editIcon?: () => any; /** * 自定义回车图标 */ - enterIcon: []; + enterIcon?: () => any; }; -} +}> -export declare class Paragraph { +export declare const Paragraph: DefineComponent<{ /** * 绑定的值,可使用 v-model 双向绑定 */ - 'model-value': string; + 'model-value'?: string; /** * 文本类型,可选值为 `secondary`、`success`、`warning`、`danger` */ - type: '' | 'secondary' | 'success' | 'warning' | 'danger'; + type?: '' | 'secondary' | 'success' | 'warning' | 'danger'; /** * 是否可以拷贝 */ - copyable: boolean; + copyable?: boolean; /** * 自定义拷贝内容 */ - 'copy-text': string; + 'copy-text'?: string; /** * 拷贝配置项,支持全局配置 */ - 'copy-config': object; + 'copy-config'?: object; /** * 是否可以编辑 */ - editable: boolean; + editable?: boolean; /** * 编辑配置项,支持全局配置 */ - 'edit-config': object; + 'edit-config'?: object; /** * 自动溢出省略 */ - ellipsis: boolean; + ellipsis?: boolean; /** * 自动溢出省略配置项,支持全局配置 */ - 'ellipsis-config': object; + 'ellipsis-config'?: object; /** * 禁用文本 */ - disabled: boolean; + disabled?: boolean; /** * 添加代码样式 */ - code: boolean; + code?: boolean; /** * 添加删除线样式 */ - delete: boolean; + delete?: boolean; /** * 添加键盘样式 */ - keyboard: boolean; + keyboard?: boolean; /** * 添加标记样式 */ - mark: boolean; + mark?: boolean; /** * 添加下划线样式 */ - underline: boolean; + underline?: boolean; /** * 是否加粗 */ - strong: boolean; + strong?: boolean; /** * 是否斜体 */ - italic: boolean; + italic?: boolean; /** * 是否开启 Tooltip 的 transfer 属性,仅适用于 ellipsis 模式 */ - transfer: boolean; + transfer?: boolean; /** * Tooltip 的 theme 属性,仅适用于 ellipsis 模式 */ - theme: 'dark' | 'light'; + theme?: 'dark' | 'light'; /** * Tooltip 的 max-width 属性,仅适用于 ellipsis 模式 */ - 'max-width': number | string; + 'max-width'?: number | string; /** * Tooltip 的 placement 属性,仅适用于 ellipsis 模式 */ - placement: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; + placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; /** * 拷贝成功时触发 */ - $emit(eventName: 'on-copy-success'): this; + onOnCopySuccess?: (event?: any) => any; /** * 拷贝失败时触发 */ - $emit(eventName: 'on-copy-error'): this; + onOnCopyError?: (event?: any) => any; /** * 进入编辑状态时触发 */ - $emit(eventName: 'on-edit-start'): this; + onOnEditStart?: (event?: any) => any; /** * 结束编辑状态时触发,即保存 */ - $emit(eventName: 'on-edit-end'): this; + onOnEditEnd?: (event?: any) => any; /** * 编辑内容时触发 */ - $emit(eventName: 'on-edit-change'): this; + onOnEditChange?: (event?: any) => any; /** * 退出编辑时触发 */ - $emit(eventName: 'on-edit-cancel'): this; + onOnEditCancel?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 文本内容,优先级低于 model-value */ - default: []; + default?: () => any; /** * 自定义拷贝图标,可选参数 copied */ - copyIcon: []; + copyIcon?: () => any; /** * 自定义编辑图标 */ - editIcon: []; + editIcon?: () => any; /** * 自定义回车图标 */ - enterIcon: []; + enterIcon?: () => any; }; -} +}> -export declare class Link { +export declare const Link: DefineComponent<{ /** * 绑定的值,可使用 v-model 双向绑定 */ - 'model-value': string; + 'model-value'?: string; /** * 跳转的链接,支持 vue-router 对象 */ - to: string | object; + to?: string | object; /** * 路由跳转时,开启 replace 将不会向 history 添加新记录 */ - replace: boolean; + replace?: boolean; /** * 相当于 a 链接的 target 属性 */ - target: string; + target?: string; /** * 同 vue-router append */ - append: boolean; + append?: boolean; /** * 文本类型,可选值为 `secondary`、`success`、`warning`、`danger` */ - type: '' | 'secondary' | 'success' | 'warning' | 'danger'; + type?: '' | 'secondary' | 'success' | 'warning' | 'danger'; /** * 是否可以拷贝 */ - copyable: boolean; + copyable?: boolean; /** * 自定义拷贝内容 */ - 'copy-text': string; + 'copy-text'?: string; /** * 拷贝配置项,支持全局配置 */ - 'copy-config': object; + 'copy-config'?: object; /** * 是否可以编辑 */ - editable: boolean; + editable?: boolean; /** * 编辑配置项,支持全局配置 */ - 'edit-config': object; + 'edit-config'?: object; /** * 自动溢出省略 */ - ellipsis: boolean; + ellipsis?: boolean; /** * 自动溢出省略配置项,支持全局配置 */ - 'ellipsis-config': object; + 'ellipsis-config'?: object; /** * 禁用文本 */ - disabled: boolean; + disabled?: boolean; /** * 添加代码样式 */ - code: boolean; + code?: boolean; /** * 添加删除线样式 */ - delete: boolean; + delete?: boolean; /** * 添加键盘样式 */ - keyboard: boolean; + keyboard?: boolean; /** * 添加标记样式 */ - mark: boolean; + mark?: boolean; /** * 添加下划线样式 */ - underline: boolean; + underline?: boolean; /** * 是否加粗 */ - strong: boolean; + strong?: boolean; /** * 是否斜体 */ - italic: boolean; + italic?: boolean; /** * 是否开启 Tooltip 的 transfer 属性,仅适用于 ellipsis 模式 */ - transfer: boolean; + transfer?: boolean; /** * Tooltip 的 theme 属性,仅适用于 ellipsis 模式 */ - theme: 'dark' | 'light'; + theme?: 'dark' | 'light'; /** * Tooltip 的 max-width 属性,仅适用于 ellipsis 模式 */ - 'max-width': number | string; + 'max-width'?: number | string; /** * Tooltip 的 placement 属性,仅适用于 ellipsis 模式 */ - placement: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; + placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; /** * 拷贝成功时触发 */ - $emit(eventName: 'on-copy-success'): this; + onOnCopySuccess?: (event?: any) => any; /** * 拷贝失败时触发 */ - $emit(eventName: 'on-copy-error'): this; + onOnCopyError?: (event?: any) => any; /** * 进入编辑状态时触发 */ - $emit(eventName: 'on-edit-start'): this; + onOnEditStart?: (event?: any) => any; /** * 结束编辑状态时触发,即保存 */ - $emit(eventName: 'on-edit-end'): this; + onOnEditEnd?: (event?: any) => any; /** * 编辑内容时触发 */ - $emit(eventName: 'on-edit-change'): this; + onOnEditChange?: (event?: any) => any; /** * 退出编辑时触发 */ - $emit(eventName: 'on-edit-cancel'): this; + onOnEditCancel?: (event?: any) => any; - $slots: { + 'v-slots'?: { /** * 文本内容,优先级低于 model-value */ - default: []; + default?: () => any; /** * 自定义拷贝图标,可选参数 copied */ - copyIcon: []; + copyIcon?: () => any; /** * 自定义编辑图标 */ - editIcon: []; + editIcon?: () => any; /** * 自定义回车图标 */ - enterIcon: []; + enterIcon?: () => any; }; -} +}> -export declare class CopyConfig { +export declare const CopyConfig: { /** * Tooltip 显示内容,为 false 则不显示 */ - tooltips: boolean | []; + tooltips?: boolean | any[]; /** * 是否显示复制成功的通知 */ - showTip: boolean; + showTip?: boolean; /** * 复制成功时的通知 */ - successTip: string; + successTip?: string; /** * 复制失败时的通知 */ - errorTip: string; + errorTip?: string; } -export declare class EditConfig { +export declare const EditConfig: { /** * Tooltip 显示内容,为 false 则不显示 */ - tooltip: boolean | string; + tooltip?: boolean | string; /** * 是否默认进入编辑状态 */ - editing: boolean; + editing?: boolean; /** * 最大输入长度 */ - maxlength: number; + maxlength?: number; /** * 自适应内容高度 */ - autosize: object; + autosize?: object; /** * 触发方式,可选值为 `icon`、`text`、`both` */ - triggerType: 'icon' | 'text' | 'both'; + triggerType?: 'icon' | 'text' | 'both'; } -export declare class EllipsisConfig { +export declare const EllipsisConfig: { /** * 最多显示的行数 */ - rows: number; + rows?: number; /** * 是否以 Tooltip 显示完整内容或自定义内容 */ - tooltip: boolean | string; + tooltip?: boolean | string; } diff --git a/types/upload.d.ts b/types/upload.d.ts index a95b90421..1e8ac0d1c 100644 --- a/types/upload.d.ts +++ b/types/upload.d.ts @@ -1,129 +1,131 @@ -export declare class Upload { +import type { DefineComponent } from 'vue'; + +export declare const Upload: DefineComponent<{ /** * 上传的地址,必填 */ - action: string; + action?: string; /** * 设置上传的请求头部 */ - headers: object; + headers?: object; /** * 是否支持多选文件 */ - multiple: boolean; + multiple?: boolean; /** * 是否支持粘贴上传文件 */ - paste: boolean; + paste?: boolean; /** * 是否开启选择文件夹,部分浏览器适用 */ - webkitdirectory: boolean; + webkitdirectory?: boolean; /** * 是否禁用 */ - disabled: boolean; + disabled?: boolean; /** * 上传时附带的额外参数 */ - data: object; + data?: object; /** * 上传的文件字段名 */ - name: string; + name?: string; /** * 支持发送 cookie 凭证信息 */ - 'with-credentials': boolean; + 'with-credentials'?: boolean; /** * 是否显示已上传文件列表 */ - 'show-upload-list': boolean; + 'show-upload-list'?: boolean; /** * 上传控件的类型,可选值为 `select`(点击选择),`drag`(支持拖拽) */ - type: 'select' | 'drag'; + type?: 'select' | 'drag'; /** * 接受上传的[文件类型](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept) */ - accept: string; + accept?: string; /** * 支持的文件类型,与 accept 不同的是,format 是识别文件的后缀名,accept 为 input 标签原生的 accept 属性,会在选择文件时过滤,可以两者结合使用 */ - format: []; + format?: any[]; /** * 文件大小限制,单位 kb */ - 'max-size': number; + 'max-size'?: number; /** * 上传文件之前的钩子,参数为上传的文件,若返回 false 或者 Promise 则停止上传 */ - 'before-upload': Function; + 'before-upload'?: Function; /** * 文件上传时的钩子,返回字段为 event, file, fileList */ - 'on-progress': Function; + 'on-progress'?: Function; /** * 文件上传成功时的钩子,返回字段为 response, file, fileList */ - 'on-success': Function; + 'on-success'?: Function; /** * 文件上传失败时的钩子,返回字段为 error, file, fileList */ - 'on-error': Function; + 'on-error'?: Function; /** * 点击已上传的文件链接时的钩子,返回字段为 file, 可以通过 file.response 拿到服务端返回数据 */ - 'on-preview': Function; + 'on-preview'?: Function; /** * 文件列表移除文件时的钩子,返回字段为 file, fileList */ - 'on-remove': Function; + 'on-remove'?: Function; /** * 文件格式验证失败时的钩子,返回字段为 file, fileList */ - 'on-format-error': Function; + 'on-format-error'?: Function; /** * 文件超出指定大小限制时的钩子,返回字段为 file, fileList */ - 'on-exceeded-size': Function; + 'on-exceeded-size'?: Function; /** * 默认已上传的文件列表,例如:```[{name: 'img1.jpg', url: 'http://www.xxx.com/img1.jpg'}, {name: 'img2.jpg', url: 'http://www.xxx.com/img2.jpg'}]``` */ - 'default-file-list': []; + 'default-file-list'?: any[]; - $slots: { + 'v-slots'?: { /** * 触发上传组件的控件 */ - '': []; + default?: () => any; /** * 辅助提示内容 */ - tip: []; + tip?: () => any; }; -} +}> diff --git a/types/viewuiplus.components.d.ts b/types/viewuiplus.components.d.ts index c765646c1..473f436e8 100644 --- a/types/viewuiplus.components.d.ts +++ b/types/viewuiplus.components.d.ts @@ -64,7 +64,7 @@ export { Spin } from './spin' export { Split } from './split' export { Steps, Step } from './steps' export { Switch } from './switch' -export { Table, TableColumn } from './table' +export { Table, TableColumnConfig } from './table' export { TablePaste } from './table-paste' export { Tabs, TabPane } from './tabs' export { Tag } from './tag' @@ -74,7 +74,7 @@ export { TimePicker } from './time-picker' export { Timeline, TimelineItem } from './timeline' export { Tooltip } from './tooltip' export { Transfer } from './transfer' -export { Tree, TreeChild } from './tree' +export { Tree, TreeChildConfig } from './tree' export { TreeSelect } from './tree-select' export { Trend } from './trend' export { Title, Text, Paragraph, Link, CopyConfig, EditConfig, EllipsisConfig } from './typography' diff --git a/types/word-count.d.ts b/types/word-count.d.ts index bc4738ad7..834c0d950 100644 --- a/types/word-count.d.ts +++ b/types/word-count.d.ts @@ -1,69 +1,71 @@ -export declare class WordCount { +import type { DefineComponent } from 'vue'; + +export declare const WordCount: DefineComponent<{ /** * 统计的文本内容 */ - 'model-value': string | number; + 'model-value'?: string | number; /** * 总字数 */ - total: number; + total?: number; /** * 是否隐藏总字数 */ - 'hide-total': boolean; + 'hide-total'?: boolean; /** * 当超出 total 时,是否显示为溢出的个数 */ - overflow: boolean; + overflow?: boolean; /** * 是否以圆环的形式显示 */ - circle: boolean; + circle?: boolean; /** * circle 模式下的尺寸 */ - size: string | number; + size?: string | number; - $slots: { + 'v-slots'?: { /** * 前缀 */ - prefix: []; + prefix?: () => any; /** * 溢出时的前缀 */ - 'prefix-overflow': []; + 'prefix-overflow'?: () => any; /** * 后缀 */ - suffix: []; + suffix?: () => any; /** * 溢出时的后缀 */ - 'suffix-overflow': []; + 'suffix-overflow'?: () => any; /** * 内容长度,支持 slot-scope, 参数:length */ - length: []; + length?: () => any; /** * 总字数,支持 slot-scope,参数:total */ - total: []; + total?: () => any; /** * 自定义分隔符 */ - separator: []; + separator?: () => any; }; -} +}>