From 454cdd176a138d3a4e61135c8523ee7f98909ae2 Mon Sep 17 00:00:00 2001 From: yangd Date: Tue, 21 Aug 2018 08:29:24 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC3.0.0=E7=9A=84iview=E5=85=A8=E9=83=A8=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=9A=84ts=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89d.ts?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/iview/affix.d.ts | 22 ++ types/iview/alert.d.ts | 48 ++++ types/iview/anchor.d.ts | 67 ++++++ types/iview/auto-complete.d.ts | 75 ++++++ types/iview/avatar.d.ts | 30 +++ types/iview/back-top.d.ts | 32 +++ types/iview/badge.d.ts | 47 ++++ types/iview/breadcrumb.d.ts | 30 +++ types/iview/button.d.ts | 86 +++++++ types/iview/card.d.ts | 53 +++++ types/iview/carousel.d.ts | 61 +++++ types/iview/cascader.d.ts | 84 +++++++ types/iview/cell.d.ts | 81 +++++++ types/iview/checkbox.d.ts | 61 +++++ types/iview/circle.d.ts | 57 +++++ types/iview/collapse.d.ts | 53 +++++ types/iview/color-picker.d.ts | 54 +++++ types/iview/date-picker.d.ts | 153 ++++++++++++ types/iview/divider.d.ts | 23 ++ types/iview/dropdown.d.ts | 79 +++++++ types/iview/form.d.ts | 100 ++++++++ types/iview/grid.d.ts | 72 ++++++ types/iview/icon.d.ts | 20 ++ types/iview/index.d.ts | 237 +++++++++++++++++++ types/iview/input-number.d.ts | 75 ++++++ types/iview/input.d.ts | 168 +++++++++++++ types/iview/iview.d.ts | 4 + types/iview/layout.d.ts | 72 ++++++ types/iview/loading-bar.d.ts | 61 +++++ types/iview/menu.d.ts | 102 ++++++++ types/iview/message.d.ts | 84 +++++++ types/iview/modal.d.ts | 218 +++++++++++++++++ types/iview/notice.d.ts | 92 ++++++++ types/iview/page.d.ts | 99 ++++++++ types/iview/poptip.d.ts | 123 ++++++++++ types/iview/progress.d.ts | 47 ++++ types/iview/radio.d.ts | 64 +++++ types/iview/rate.d.ts | 54 +++++ types/iview/scroll.d.ts | 35 +++ types/iview/select.d.ts | 141 +++++++++++ types/iview/slider.d.ts | 70 ++++++ types/iview/spin.d.ts | 26 ++ types/iview/split.d.ts | 68 ++++++ types/iview/steps.d.ts | 48 ++++ types/iview/switch.d.ts | 54 +++++ types/iview/table.d.ts | 419 +++++++++++++++++++++++++++++++++ types/iview/tabs.d.ts | 81 +++++++ types/iview/tag.d.ts | 48 ++++ types/iview/time-picker.d.ts | 169 +++++++++++++ types/iview/time.ts | 27 +++ types/iview/timeline.d.ts | 34 +++ types/iview/tooltip.d.ts | 91 +++++++ types/iview/transfer.d.ts | 80 +++++++ types/iview/tree.d.ts | 103 ++++++++ types/iview/upload.d.ts | 130 ++++++++++ 55 files changed, 4512 insertions(+) create mode 100644 types/iview/affix.d.ts create mode 100644 types/iview/alert.d.ts create mode 100644 types/iview/anchor.d.ts create mode 100644 types/iview/auto-complete.d.ts create mode 100644 types/iview/avatar.d.ts create mode 100644 types/iview/back-top.d.ts create mode 100644 types/iview/badge.d.ts create mode 100644 types/iview/breadcrumb.d.ts create mode 100644 types/iview/button.d.ts create mode 100644 types/iview/card.d.ts create mode 100644 types/iview/carousel.d.ts create mode 100644 types/iview/cascader.d.ts create mode 100644 types/iview/cell.d.ts create mode 100644 types/iview/checkbox.d.ts create mode 100644 types/iview/circle.d.ts create mode 100644 types/iview/collapse.d.ts create mode 100644 types/iview/color-picker.d.ts create mode 100644 types/iview/date-picker.d.ts create mode 100644 types/iview/divider.d.ts create mode 100644 types/iview/dropdown.d.ts create mode 100644 types/iview/form.d.ts create mode 100644 types/iview/grid.d.ts create mode 100644 types/iview/icon.d.ts create mode 100644 types/iview/index.d.ts create mode 100644 types/iview/input-number.d.ts create mode 100644 types/iview/input.d.ts create mode 100644 types/iview/iview.d.ts create mode 100644 types/iview/layout.d.ts create mode 100644 types/iview/loading-bar.d.ts create mode 100644 types/iview/menu.d.ts create mode 100644 types/iview/message.d.ts create mode 100644 types/iview/modal.d.ts create mode 100644 types/iview/notice.d.ts create mode 100644 types/iview/page.d.ts create mode 100644 types/iview/poptip.d.ts create mode 100644 types/iview/progress.d.ts create mode 100644 types/iview/radio.d.ts create mode 100644 types/iview/rate.d.ts create mode 100644 types/iview/scroll.d.ts create mode 100644 types/iview/select.d.ts create mode 100644 types/iview/slider.d.ts create mode 100644 types/iview/spin.d.ts create mode 100644 types/iview/split.d.ts create mode 100644 types/iview/steps.d.ts create mode 100644 types/iview/switch.d.ts create mode 100644 types/iview/table.d.ts create mode 100644 types/iview/tabs.d.ts create mode 100644 types/iview/tag.d.ts create mode 100644 types/iview/time-picker.d.ts create mode 100644 types/iview/time.ts create mode 100644 types/iview/timeline.d.ts create mode 100644 types/iview/tooltip.d.ts create mode 100644 types/iview/transfer.d.ts create mode 100644 types/iview/tree.d.ts create mode 100644 types/iview/upload.d.ts diff --git a/types/iview/affix.d.ts b/types/iview/affix.d.ts new file mode 100644 index 00000000..b5b020b0 --- /dev/null +++ b/types/iview/affix.d.ts @@ -0,0 +1,22 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Affix extends Vue { + /** + * 距离窗口顶部达到指定偏移量后触发 + * @default 0 + */ + 'offset-top'?: number; + /** + * 距离窗口底部达到指定偏移量后触发 + */ + 'offset-bottom'?: number; + /** + * 在固定状态发生改变时触发 + * @param value true | false + */ + $emit(eventName: 'on-change', value: boolean): this; +} \ No newline at end of file diff --git a/types/iview/alert.d.ts b/types/iview/alert.d.ts new file mode 100644 index 00000000..ffaf36e8 --- /dev/null +++ b/types/iview/alert.d.ts @@ -0,0 +1,48 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Alert extends Vue { + /** + * 警告提示样式,可选值为info、success、warning、error + * @default info + */ + type?: 'info' | 'success' | 'warning' | 'error'; + /** + * 是否可关闭 + * @default false + */ + closable?: boolean; + /** + * 是否显示图标 + * @default false + */ + 'show-icon'?: boolean; + /** + * 关闭时触发 + */ + $emit(eventName: 'on-close', event: HTMLElement): this; + /** + * slot插槽对象 + */ + $slots: { + /** + * 警告提示内容 + */ + '': VNode[]; + /** + * 警告提示辅助性文字介绍 + */ + desc: VNode[]; + /** + * 自定义图标内容 + */ + icon: VNode[]; + /** + * 自定义关闭内容 + */ + close: VNode[]; + }; +} \ No newline at end of file diff --git a/types/iview/anchor.d.ts b/types/iview/anchor.d.ts new file mode 100644 index 00000000..d1071b3d --- /dev/null +++ b/types/iview/anchor.d.ts @@ -0,0 +1,67 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Anchor extends Vue { + /** + * 固定模式 + * @default true + */ + affix?: boolean; + /** + * 距离窗口顶部达到指定偏移量后触发 + * @default 0 + */ + 'offset-top'?: number; + /** + * 距离窗口底部达到指定偏移量后触发 + */ + 'offset-bottom'?: number; + /** + * 锚点区域边界,单位:px + * @default 5 + */ + bounds?: number; + /** + * 点击滚动的额外距离 + * @default 0 + */ + 'scroll-offset'?: number; + /** + * 指定滚动的容器 + */ + container?: string | HTMLElement; + /** + * 是否显示小圆点 + * @default false + */ + 'show-ink'?: boolean; + /** + * 点击锚点时触发,返回链接 + */ + $emit(eventName: 'on-select', href: string): this; + /** + * 链接改变时触发,返回新链接和旧链接 + */ + $emit(eventName: 'on-change', []): this; +} + +export interface AnchorLink extends Vue { + /** + * 锚点链接 + * @default + */ + href?: string; + /** + * 文字内容 + * @default + */ + title?: string; + /** + * 点击滚动的额外距离 + * @default 0 + */ + 'scroll-offset'?: number; +} \ No newline at end of file diff --git a/types/iview/auto-complete.d.ts b/types/iview/auto-complete.d.ts new file mode 100644 index 00000000..40183a27 --- /dev/null +++ b/types/iview/auto-complete.d.ts @@ -0,0 +1,75 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface AutoComplete extends Vue { + /** + * 绑定的值,可使用 v-model 双向绑定 + */ + value?: string | number; + /** + * 自动完成的数据源 + * @default [] + */ + data?: string[] | number[]; + /** + * 是否可以清空选项 + * @default false + */ + clearable?: boolean; + /** + * 是否禁用 + * @default false + */ + disabled?: boolean; + /** + * 占位文本 + */ + placeholder?: string; + /** + * 输入框尺寸,可选值为 large、small、default 或者不设置 + */ + size?: '' | 'large' | 'small' | 'default'; + /** + * 输入框尾部图标 + */ + icon?: string; + /** + * 是否根据输入项进行筛选。当其为一个函数时,会接收 value 和 option 两个参数, + * 当 option 符合筛选条件时,应返回 true,反之则返回 false, + * @default false + */ + 'filter-method'?: boolean | (() => boolean); + /** + * 是否将弹层放置于 body 内,在 Tabs、带有 fixed 的 Table 列内使用时, + * 建议添加此属性,它将不受父级样式影响,从而达到更好的效果, + * @default false + */ + transfer?: boolean; + /** + * 给表单元素设置 id,详见 Form 用法。 + */ + 'element-id'?: string; + /** + * 选中 option,或 input 的 value 变化时,调用此函数 + */ + $emit(eventName: 'on-change', value: string | number): this; + /** + * 被选中时调用,参数为选中项的 value 值 + */ + $emit(eventName: 'on-select', value: string | number): this; + /** + * 搜索补全项的时候调用 + */ + $emit(eventName: 'on-search', query: string): this; + /** + * 搜索补全项的时候调用 + */ + $emit(eventName: 'on-focus', event: KeyboardEvent): this; + /** + * 搜索补全项的时候调用 + */ + $emit(eventName: 'on-blur', event: KeyboardEvent): this; +} diff --git a/types/iview/avatar.d.ts b/types/iview/avatar.d.ts new file mode 100644 index 00000000..dfa37203 --- /dev/null +++ b/types/iview/avatar.d.ts @@ -0,0 +1,30 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Avatar extends Vue { + /** + * 指定头像的形状,可选值为 circle、square + * @default circle + */ + shape?: 'circle' | 'square'; + /** + * 设置头像的大小,可选值为 large、small、default + * @default default + */ + size?: 'large'|'small'|'default'; + /** + * 图片类头像的资源地址 + */ + src?: string; + /** + * 设置头像的图标类型,参考 Icon 组件 + */ + icon?: string; + /** + * 自定义图标 + */ + 'custom-icon'?: string; +} \ No newline at end of file diff --git a/types/iview/back-top.d.ts b/types/iview/back-top.d.ts new file mode 100644 index 00000000..28a2f881 --- /dev/null +++ b/types/iview/back-top.d.ts @@ -0,0 +1,32 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface BackTop extends Vue { + /** + * 页面滚动高度达到该值时才显示BackTop组件 + * @default 400 + */ + height?: number; + /** + * 组件距离底部的距离 + * @default 30 + */ + bottom?: number; + /** + * 组件距离右部的距离 + * @default 30 + */ + right?: number; + /** + * 滚动动画持续时间,单位 毫秒 + * @default 1000 + */ + duration?: number; + /** + * 点击按钮时触发 + */ + $emit(eventName: 'on-click'): this; +} diff --git a/types/iview/badge.d.ts b/types/iview/badge.d.ts new file mode 100644 index 00000000..2be4658d --- /dev/null +++ b/types/iview/badge.d.ts @@ -0,0 +1,47 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Badge extends Vue { + /** + * 显示的数字,大于overflowCount时,显示${overflowCount}+,为 0 时隐藏 + */ + count?: number | string; + /** + * 展示封顶的数字值 + * @default 99 + */ + 'overflow-count'?: number | string; + /** + * 不展示数字,只有一个小红点,如需隐藏 dot ,需要设置count为 0 + * @default false + */ + dot?: boolean + /** + * 自定义的class名称,dot 模式下无效 + */ + 'class-name'?: string; + /** + * 使用预设的颜色,可选值为 success、primary、normal、error、warning、info + */ + type?: 'success' | 'primary' | 'normal' | 'error' | 'warning' | 'info'; + /** + * 当数值为 0 时,是否展示 Badge + * @default false + */ + 'show-zero'?: boolean; + /** + * 设置 Badge 为状态点,可选值为 success、processing、default、error、warning + */ + status?: 'success' | 'processing' | 'default' | 'error' | 'warning'; + /** + * 自定义内容,如果设置了 status,则为状态点的文本 + */ + text?: string; + /** + * 设置状态点的位置偏移,格式为 [x, y] + */ + offset?: number[]; +} \ No newline at end of file diff --git a/types/iview/breadcrumb.d.ts b/types/iview/breadcrumb.d.ts new file mode 100644 index 00000000..6491a107 --- /dev/null +++ b/types/iview/breadcrumb.d.ts @@ -0,0 +1,30 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Breadcrumb extends Vue { + /** + * 自定义分隔符 + * @default / + */ + separator?: string; +} + +export interface BreadcrumbItem extends Vue { + /** + * 链接,不传则没有链接 + */ + to?: string | object; + /** + * 路由跳转时,开启 replace 将不会向 history 添加新记录 + * @default false + */ + replace?: boolean; + /** + * 相当于 a 链接的 target 属性 + * @default _self + */ + target?: '_blank' | '_self' | '_parent' | '_top'; +} \ No newline at end of file diff --git a/types/iview/button.d.ts b/types/iview/button.d.ts new file mode 100644 index 00000000..9a994dad --- /dev/null +++ b/types/iview/button.d.ts @@ -0,0 +1,86 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Button extends Vue { + /** + * 按钮类型,可选值为 default、primary、dashed、text、info、success、warning、error或者不设置 + * @default default + */ + type?: '' | 'default' | 'primary' | 'dashed' | 'text' | 'info' | 'success' | 'warning' | 'error'; + /** + * 幽灵属性,使按钮背景透明 + * @default false + */ + ghost?: boolean; + /** + * 按钮大小,可选值为large、small、default或者不设置 + * @default default + */ + size?: '' | 'large' | 'small' | 'default'; + /** + * 按钮形状,可选值为circle或者不设置 + */ + shape?: '' | 'circle'; + /** + * 开启后,按钮的长度为 100% + * @default false + */ + long?: boolean; + /** + * 设置button原生的type,可选值为button、submit、reset + * @default button + */ + 'html-type'?: 'button' | 'submit' | 'reset'; + /** + * 设置按钮为禁用状态 + * @default false + */ + disabled?: boolean; + /** + * 设置按钮为加载中状态 + * @default false + */ + loading?: boolean; + /** + * 设置按钮的图标类型 + */ + icon?: string; + /** + * 设置按钮的自定义图标 + */ + 'custom-icon'?: string; + /** + * 跳转的链接,支持 vue-router 对象 + */ + to?: string | object; + /** + * 路由跳转时,开启 replace 将不会向 history 添加新记录 + * @default false + */ + replace?: boolean; + /** + * 相当于 a 链接的 target 属性 + * @default _self + */ + target?: '_blank' | '_self' | '_parent' | '_top'; +} + +export interface ButtonGroup extends Vue { + /** + * 按钮组合大小,可选值为large、small、default或者不设置 + * @default default + */ + size?: 'large' | 'small' | 'default'; + /** + * 按钮组合形状,可选值为circle或者不设置 + */ + shape?: '' | 'circle'; + /** + * 是否纵向排列按钮组 + * @default false + */ + vertical?: boolean; +} \ No newline at end of file diff --git a/types/iview/card.d.ts b/types/iview/card.d.ts new file mode 100644 index 00000000..b9864d51 --- /dev/null +++ b/types/iview/card.d.ts @@ -0,0 +1,53 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Card extends Vue { + /** + * 是否显示边框,建议在灰色背景下使用 + * @default true + */ + 'bordered'?: boolean; + /** + * 禁用鼠标悬停显示阴影 + * @default false + */ + 'dis-hover'?: boolean; + /** + * 卡片阴影,建议在灰色背景下使用 + * @default false + */ + 'shadow'?: boolean; + /** + * 卡片内部间距,单位 px + * @default 16 + */ + 'padding'?: number; + /** + * 标题,2.12.0 新增 + */ + title?: string; + /** + * 标题前的图标,2.12.0 新增 + */ + icon?: string; + /** + * slot插槽对象 + */ + $slots: { + /** + * 自定义卡片标题,如果是简单文字,可以使用

标签包裹 + */ + title: VNode[]; + /** + * 额外显示的内容,默认位置在右上角 + */ + extra: VNode[]; + /** + * 卡片主体内容 + */ + '': VNode[]; + }; +} \ No newline at end of file diff --git a/types/iview/carousel.d.ts b/types/iview/carousel.d.ts new file mode 100644 index 00000000..3d636519 --- /dev/null +++ b/types/iview/carousel.d.ts @@ -0,0 +1,61 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Carousel extends Vue { + /** + * 幻灯片的索引,从 0 开始,可以使用 v-model 双向绑定数据 + * @default 0 + */ + value?: number; + /** + * 走马灯的高度,可填 auto 或具体高度数值,单位 px + * @default auto + */ + height?: string | number; + /** + * 是否开启循环 + * @default false + */ + loop?: boolean; + /** + * 是否自动切换 + */ + autoplay?: boolean; + /** + * 自动切换的时间间隔,单位为毫秒 + * @default 2000 + */ + 'autoplay-speed'?: number; + /** + * 指示器的位置,可选值为 inside (内部),outside(外部),none(不显示) + * @default inside + */ + dots?: 'inside' | 'outside' | 'none'; + /** + * 是否显示圆形指示器 + * @default false + */ + 'radius-dot'?: boolean; + /** + * 指示器的触发方式,可选值为 click(点击),hover(悬停) + * @default click + */ + trigger?: 'click' | 'hover'; + /** + * 切换箭头的显示时机,可选值为 hover(悬停),always(一直显示),never(不显示) + * @default hover + */ + arrow?: 'hover' | 'always' | 'never'; + /** + * 动画效果 + * @default ease + */ + easing?: string; + /** + * 幻灯片切换时触发,目前激活的幻灯片的索引,原幻灯片的索引 + */ + $emit(eventName: 'on-change', oldValue: number, value: number): this; +} \ No newline at end of file diff --git a/types/iview/cascader.d.ts b/types/iview/cascader.d.ts new file mode 100644 index 00000000..67082d31 --- /dev/null +++ b/types/iview/cascader.d.ts @@ -0,0 +1,84 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Cascader extends Vue { + /** + * 可选项的数据源,格式参照示例说明 + * @default [] + */ + data?: object[]; + /** + * 当前已选项的数据,格式参照示例说明 + * @default [] + */ + value?: object[]; + /** + * 选择后展示的函数,用于自定义显示格式 + * @default label => label.join(' / ') + */ + 'render-format'?: (label?: string[]) => string + /** + * 是否禁用选择器 + * @default false + */ + disabled?: boolean; + /** + * 是否支持清除 + * @default true + */ + clearable?: boolean; + /** + * 输入框占位符 + * @default 请选择 + */ + placeholder?: string; + /** + * 次级菜单展开方式,可选值为 click 或 hover + * @default click + */ + trigger?: 'click' | 'hover'; + /** + * 当此项为 true 时,点选每级菜单选项值都会发生变化,具体见上面的示例 + * @default false + */ + 'change-on-select'?: boolean; + /** + * 输入框大小,可选值为large和small或者不填 + */ + size?: '' | 'large' | 'small'; + /** + * 动态获取数据,数据源需标识 loading + */ + 'load-data'?: () => void; + /** + * 是否支持搜索 + * @default false + */ + filterable?: boolean; + /** + * 当搜索列表为空时显示的内容 + * @default 无匹配数据 + */ + 'not-found-text'?: string; + /** + * 是否将弹层放置于 body 内,在 Tabs、带有 fixed 的 Table 列内使用时, + * 建议添加此属性,它将不受父级样式影响,从而达到更好的效果 + * @default false + */ + transfer?: boolean; + /** + * 给表单元素设置 id,详见 Form 用法。 + */ + 'element-id'?: string; + /** + * 选择完成后的回调,返回值 value 即已选值 value,selectedData 为已选项的具体数据 + */ + $emit(eventName: 'on-change', value: object, selectedData: object[]): this; + /** + * 展开和关闭弹窗时触发 + */ + $emit(eventName: 'on-visible-change', status: boolean): this; +} \ No newline at end of file diff --git a/types/iview/cell.d.ts b/types/iview/cell.d.ts new file mode 100644 index 00000000..42a0acaf --- /dev/null +++ b/types/iview/cell.d.ts @@ -0,0 +1,81 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Cell extends Vue { + /** + * 用来标识这一项 + */ + name?: string | number; + /** + * 左侧标题 + */ + title?: string; + /** + * 标题下方的描述信息 + */ + label?: string; + /** + * 右侧额外内容 + */ + extra?: string; + /** + * 禁用该项 + * @default false + */ + disabled?: boolean; + /** + * 标记该项为选中状态 + * @default false + */ + selected?: boolean; + /** + * 跳转的链接,支持 vue-router 对象 + */ + to?: string | object; + /** + * 路由跳转时,开启 replace 将不会向 history 添加新记录 + * @default false + */ + replace?: boolean; + /** + * 相当于 a 链接的 target 属性 + * @default _self + */ + target?: '_blank' | '_self' | '_parent' | '_top'; + /** + * slot插槽对象 + */ + $slots: { + /** + * 相当于 title + */ + '': VNode[]; + /** + * 标题前的 Icon + */ + icon: VNode[]; + /** + * 相当于 label + */ + label: VNode[]; + /** + * 相当于 extra + */ + extra: VNode[]; + /** + * 有链接时,可自定义右侧箭头 + */ + arrow: VNode[]; + } +} + +export interface CellGroup extends Vue { + /** + * 点击单元格时触发 + * + */ + $emit(eventName: 'on-click', name: string): this; +} \ No newline at end of file diff --git a/types/iview/checkbox.d.ts b/types/iview/checkbox.d.ts new file mode 100644 index 00000000..43d35bc5 --- /dev/null +++ b/types/iview/checkbox.d.ts @@ -0,0 +1,61 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Checkbox extends Vue { + /** + * 只在单独使用时有效。可以使用 v-model 双向绑定数据 + * @default false + */ + value?: boolean; + /** + * 只在组合使用时有效。指定当前选项的 value 值,组合会自动判断是否选中 + */ + label?: string | number | boolean; + /** + * 是否禁用当前项 + * @default false + */ + disabled?: boolean; + /** + * 设置 indeterminate 状态,只负责样式控制 + * @default false + */ + indeterminate?: boolean; + /** + * 多选框的尺寸,可选值为 large、small、default 或者不设置 + */ + size?: '' | 'large' | 'small' | 'default'; + /** + * 选中时的值,当使用类似 1 和 0 来判断是否选中时会很有用 + * @default true + */ + 'true-value'?: string | number | boolean; + /** + * 没有选中时的值,当使用类似 1 和 0 来判断是否选中时会很有用 + * @default false + */ + 'false-value'?: string | number | boolean; + /** + * 只在单独使用时有效。在选项状态发生改变时触发,通过修改外部的数据改变时不会触发 + */ + $emit(eventName: 'on-change', value: boolean): this; +} + +export interface CheckboxGroup extends Vue { + /** + * 指定选中项目的集合,可以使用 v-model 双向绑定数据 + * @default [] + */ + value?: string[] | number[] | boolean[]; + /** + * 多选框组的尺寸,可选值为 large、small、default 或者不设置 + */ + size?: '' | 'large' | 'small' | 'default'; + /** + * 在选项状态发生改变时触发,返回已选中的数组。通过修改外部的数据改变时不会触发 + */ + $emit(eventName: 'on-change', values: Array): this; +} \ No newline at end of file diff --git a/types/iview/circle.d.ts b/types/iview/circle.d.ts new file mode 100644 index 00000000..f4adce51 --- /dev/null +++ b/types/iview/circle.d.ts @@ -0,0 +1,57 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Circle extends Vue { + /** + * 百分比 + * @default 0 + */ + percent?: number; + /** + * 图表的宽度和高度,单位 px + * @default 120 + */ + size?: number; + /** + * 进度环顶端的形状,可选值为square(方)和round(圆) + * @default round + */ + 'stroke-linecap'?: 'square' | 'round'; + /** + * 进度环的线宽,单位 px + * @default 6 + */ + 'stroke-width'?: number; + /** + * 进度环的颜色 + * @default #2db7f5 + */ + 'stroke-color'?: string + /** + * 进度环背景的线宽,单位 px + * @default 5 + */ + 'trail-width'?: number; + /** + * 进度环背景的颜色 + * @default #eaeef2 + */ + 'trail-color'?: string; + /** + * 是否显示为仪表盘 + * @default false + */ + dashboard?: boolean; + /** + * slot插槽对象 + */ + $slots: { + /** + * 自定义显示中间内容,内容默认垂直居中 + */ + '': VNode[]; + }; +} \ No newline at end of file diff --git a/types/iview/collapse.d.ts b/types/iview/collapse.d.ts new file mode 100644 index 00000000..0d6a2c4d --- /dev/null +++ b/types/iview/collapse.d.ts @@ -0,0 +1,53 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Collapse extends Vue { + /** + * 当前激活的面板的 name,可以使用 v-model 双向绑定 + */ + value?: string[] | string; + /** + * 是否开启手风琴模式,开启后每次至多展开一个面板 + * @default false + */ + accordion?: boolean; + /** + * 是否开启简洁模式 + * @default false + */ + simple?: boolean; + /** + * 切换面板时触发,返回当前已展开的面板的 key,格式为数组 + * @default [] + */ + $emit(eventName: 'on-change', []): this; +} + +export interface CollapsePanel extends Vue { + /** + * 当前面板的 name,与 Collapse的value对应,不填为索引值 + * @default index的值 + */ + name?: string; + /** + * 隐藏箭头 + * @default false + */ + 'hide-arrow'?: boolean; + /** + * slot插槽对象 + */ + $slots: { + /** + * 面板头内容 + */ + '': VNode[]; + /** + * 描素内容 + */ + content: VNode[]; + }; +} \ No newline at end of file diff --git a/types/iview/color-picker.d.ts b/types/iview/color-picker.d.ts new file mode 100644 index 00000000..0b3258d3 --- /dev/null +++ b/types/iview/color-picker.d.ts @@ -0,0 +1,54 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface ColorPicker extends Vue { + /** + * 绑定的值,可使用 v-model 双向绑定 + */ + value?: string; + /** + * 是否支持透明度选择 + * @default false + */ + alpha?: boolean; + /** + * 是否支持色彩选择 + * @default true + */ + hue?: boolean; + /** + * 是否支持透明度选择 + * @default false + */ + recommend?: boolean; + /** + * 自定义颜色预设 + */ + colors?: string[]; + /** + * 颜色的格式,可选值为 hsl、hsv、hex、rgb + * @default 开启 alpha 时为 rgb,其它为 hex + */ + format?: 'hsl' | 'hsv' | 'hex' | 'rgb'; + /** + * 尺寸,可选值为large、small、default或者不设置 + */ + size?: '' | 'large' | 'small' | 'default'; + /** + * 当绑定值变化时触发 + * @default 当前值 + */ + $emit(eventName: 'on-change', value: string): this; + /** + * 面板中当前显示的颜色发生改变时触发 + * @default 当前显示的颜色值 + */ + $emit(eventName: 'on-active-change', value: string): this; + /** + * 下拉框展开或收起时触发 + */ + $emit(eventName: 'on-open-change', value: boolean): this; +} \ No newline at end of file diff --git a/types/iview/date-picker.d.ts b/types/iview/date-picker.d.ts new file mode 100644 index 00000000..0bf488b6 --- /dev/null +++ b/types/iview/date-picker.d.ts @@ -0,0 +1,153 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface DatePicker extends Vue { + /** + * 显示类型,可选值为 date、daterange、datetime、datetimerange、year、month'|'默认值date + */ + type?: 'date' | 'daterange' | 'datetime' | 'datetimerange' | 'year' | 'month'; + /** + * 日期,可以是 JavaScript 的 Date,例如 new Date(),也可以是标准的日期格式,点击右边查看 + * 注意:value 使用 v-model 时,值是 Date 类型,可以配合 @on-change 使用 + */ + value?: Date; + /** + * 展示的日期格式 + * date | daterange?: yyyy-MM-dd + * datetime | datetimerange:yyyy-MM-dd HH:mm:ss + * year:yyyy + * month:yyyy-MM + */ + format?: string; + /** + * 日期选择器出现的位置, + * 可选值为top,top-start,top-end, + * bottom,bottom-start,bottom-end, + * left,left-start,left-end, + * right,right-start,right-end + * 2.12.0 版本开始支持自动识别 + * @default bottom-start + */ + placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end' + /** + * 占位文本默认值空 + * @default 空 + */ + placeholder?: string; + /** + * 选择器额外配置,比如不可选日期与快捷选项,具体项详见下表 + */ + options?: object; + /** + * 开启后,左右面板不联动,仅在 daterange 和 datetimerange 下可用。 + * @default false + */ + 'split-panels'?: boolean; + /** + * 开启后,可以选择多个日期,仅在 date 下可用。 + * @default false + */ + multiple?: boolean; + /** + * 开启后,可以显示星期数。 + * @default false + */ + 'show-week-numbers': boolean; + /** + * 设置默认显示的起始日期。 + */ + 'start-date'?: Date; + /** + * 是否显示底部控制栏,开启后,选择完日期,选择器不会主动关闭,需用户确认后才可关闭, + * @default false + */ + confirm?: boolean; + /** + * 手动控制日期选择器的显示状态,true 为显示,false 为收起。使用该属性后,选择器不会主动关闭。 + * 建议配合 slot 及 confirm 和相关事件一起使用 + * @default null + */ + open?: boolean; + /** + * 尺寸,可选值为large、small、default或者不设置 + */ + size?: '' | 'large' | 'small' | 'default'; + /** + * 是否禁用选择器 + * @default false + */ + disabled?: boolean; + /** + * 是否显示清除按钮 + * @default true + */ + clearable?: boolean; + /** + * 完全只读,开启后不会弹出选择器,只在没有设置 open 属性下生效 + * @default false + */ + readonly?: boolean; + /** + * 文本框是否可以输入,只在没有使用 slot 时有效 + * @default true + */ + editable?: boolean; + /** + * 是否将弹层放置于 body 内,在 Tabs、带有 fixed 的 Table 列内使用时, + * 建议添加此属性,它将不受父级样式影响,从而达到更好的效果, + * @default false + */ + transfer?: boolean; + /** + * 给表单元素设置 id,详见 Form 用法。 + */ + 'element-id'?: string; + /** + * 可以在 type 为 datetime 和 datetimerange 下,配置 TimePicker 的属性, + * 比如时间间隔 steps::time-picker-options="{steps: [1, 10, 10]}" + * @default {} + */ + 'time-picker-options'?: object; + /** + * 日期发生变化时触发 已经格式化后的日期,比如 2016-01-01 + */ + $emit(eventName: 'on-change', value: string): this; + /** + * 弹出日历和关闭日历时触发 + */ + $emit(eventName: 'on-open-change', value: boolean): this; + /** + * 在 confirm 模式下有效,点击确定按钮时触发 + */ + $emit(eventName: 'on-ok'): this; + /** + * 在 confirm 模式或 clearable = true 时有效,在清空日期时触发 + */ + $emit(eventName: 'on-clear'): this; + /** + * slot插槽对象 + */ + $slots: { + /** + * 自定义选择器的显示内容,建议与 open 等参数一起使用,详见示例 + */ + '': VNode[]; + }; +} + +export interface DatePickerOptions extends Vue { + /** + * 设置快捷选项,每项内容: + * text:显示的文案 + * value?: 返回指定的日期,如需自己控制逻辑,可不设置,并使用 onClick 回调 + * onClick?: 点击时的回调,参数为当前日期选择器的 Vue 实例,当需要自定义复杂操作时,可以使用 + */ + shortcuts?: { text?: string, value?: () => void, onClick?: () => void }[]; + /** + * 设置不可选择的日期,参数为当前的日期,需要返回 Boolean 是否禁用这天 + */ + disabledDate(): boolean; +} \ No newline at end of file diff --git a/types/iview/divider.d.ts b/types/iview/divider.d.ts new file mode 100644 index 00000000..a2521ab5 --- /dev/null +++ b/types/iview/divider.d.ts @@ -0,0 +1,23 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Divider extends Vue { + /** + * 水平还是垂直类型,可选值为 horizontal 或 vertical + * @default horizontal + */ + type?: 'horizontal' | 'vertical'; + /** + * 分割线标题的位置,可选值为 left、right 或 center + * @default center + */ + orientation?: 'left' | 'right' | 'center'; + /** + * 是否虚线 + * @default false + */ + dashed?: boolean; +} \ No newline at end of file diff --git a/types/iview/dropdown.d.ts b/types/iview/dropdown.d.ts new file mode 100644 index 00000000..f21b2ae6 --- /dev/null +++ b/types/iview/dropdown.d.ts @@ -0,0 +1,79 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Dropdown extends Vue { + /** + * 触发方式,可选值为 hover(悬停)click(点击)contextMenu(右键)custom(自定义),使用 custom 时,需配合 visible 一起使用 + * @default hover + */ + trigger?: 'hover'|'click'|'custom'|'contextMenu'; + /** + * 手动控制下拉框的显示,在 trigger = 'custom' 时使用 + * @default false + */ + visible?: boolean; + /** + * 下拉菜单出现的位置,可选值为 + * top,top-start,top-end,bottom,bottom-start,bottom-end, + * left,left-start,left-end,right,right-start,right-end + * 2.12.0 版本开始支持自动识别 + * @default bottom + */ + 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 列内使用时,建议添加此属性,它将不受父级样式影响,从而达到更好的效果 + * @default false + */ + transfer?: boolean; + /** + * 点击菜单项时触发 + * + */ + $emit(eventName: 'on-click', value: string): this; + /** + * 菜单显示状态改变时调用 + */ + $emit(eventName: 'on-visible-change', value: boolean): this; + /** + * 点击外部关闭下拉菜单时触发 + */ + $emit(eventName: 'on-clickoutside', event: object): this; + /** + * slot插槽对象 + */ + $slots: { + /** + * 主体内容 + */ + '': VNode[]; + /** + * 列表内容,一般由 DropdownMenu 承担 + */ + list: VNode[]; + }; +} + +export interface DropdownItem extends Vue { + /** + * 用来标识这一项 + */ + name?: string; + /** + * 禁用该项 + * @default false + */ + disabled?: boolean; + /** + * 显示分割线 + * @default false + */ + divided?: boolean; + /** + * 标记该项为选中状态 + * @default false + */ + selected?: boolean; +} \ No newline at end of file diff --git a/types/iview/form.d.ts b/types/iview/form.d.ts new file mode 100644 index 00000000..72d8588f --- /dev/null +++ b/types/iview/form.d.ts @@ -0,0 +1,100 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Form extends Vue { + /** + * 表单数据对象 + */ + model?: object; + /** + * 表单验证规则,具体配置查看 async-validator + */ + rules?: object; + /** + * 是否开启行内表单模式 + * @default false + */ + inline?: boolean; + /** + * 表单域标签的位置,可选值为 left、right、top + * @default right + */ + 'label-position'?: 'left'|'right'|'top'; + /** + * 表单域标签的宽度,所有的 FormItem 都会继承 Form 组件的 label-width 的值 + */ + 'label-width'?: number; + /** + * 是否显示校验错误信息 + * @default true + */ + 'show-message'?: boolean; + /** + * 对整个表单进行校验,参数为检验完的回调,会返回一个 Boolean 表示成功与失败 + */ + validate(callback?: (valid?: boolean) => void): void; + /** + * 对部分表单字段进行校验的方法,参数1为需校验的 prop,参数2为检验完回调,返回错误信息 + */ + validateField(prop?: string, callback?: (valid?: boolean) => void): void; + /** + * 对整个表单进行重置,将所有字段值重置为空并移除校验结果 + */ + resetFields(): void; +} + +export interface FormItem extends Vue { + /** + * 对应表单域 model 里的字段 + */ + prop?: string; + /** + * 标签文本 + */ + label?: string; + /** + * 表单域标签的的宽度 + */ + 'label-width'?: number; + /** + * 指定原生的 label 标签的 for 属性,配合控件的 element-id 属性,可以点击 label 时聚焦控件。 + */ + 'label-for'?: string; + /** + * 是否必填,如不设置,则会根据校验规则自动生成 + */ + required?: boolean; + /** + * 表单验证规则 + */ + rules?: object | Array; + /** + * 表单域验证错误信息, 设置该值会使表单验证状态变为error,并显示该错误信息 + */ + error?: string; + /** + * 是否显示校验错误信息 + * @default true + */ + 'show-message'?: boolean; + /** + * slot插槽对象 + */ + $slots: { + /** + * 内容 + */ + '': VNode[]; + /** + * label 内容 + */ + label: VNode[]; + }; +} + + + + diff --git a/types/iview/grid.d.ts b/types/iview/grid.d.ts new file mode 100644 index 00000000..41f7dfab --- /dev/null +++ b/types/iview/grid.d.ts @@ -0,0 +1,72 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface GridRow extends Vue { + /** + * 栅格间距,单位 px,左右平分 + * @default 0 + */ + gutter?: number; + /** + * 布局模式,可选值为flex或不选,在现代浏览器下有效 + */ + type?: string; + /** + * lex 布局下的垂直对齐方式,可选值为top、middle、bottom + */ + align?: 'top'|'middle'|'bottom'; + /** + * flex 布局下的水平排列方式,可选值为start、end、center、space-around、space-between + */ + justify?: 'start'|'end'|'center'|'space-around'|'space-between'; + /** + * 自定义的class名称 + */ + 'class-name'?: string; +} + +export interface GridCol extends Vue { + /** + * 栅格的占位格数,可选值为0~24的整数,为 0 时,相当于display:none + */ + span?: number | string; + /** + * 栅格的顺序,在flex布局模式下有效 + */ + order?: number | string; + /** + * 栅格左侧的间隔格数,间隔内不可以有栅格 + */ + offset?: number | string; + /** + * 栅格向右移动格数 + */ + push?: number | string; + /** + * 栅格向左移动格数 + */ + pull?: number | string; + /** + * 自定义的class名称 + */ + 'class-name'?: string; + /** + * <768px 响应式栅格,可为栅格数或一个包含其他属性的对象 + */ + xs?: number | object; + /** + * ≥768px 响应式栅格,可为栅格数或一个包含其他属性的对象 + */ + sm?: number | object; + /** + * ≥992px 响应式栅格,可为栅格数或一个包含其他属性的对象 + */ + md?: number | object; + /** + * ≥1200px 响应式栅格,可为栅格数或一个包含其他属性的对象 + */ + lg?: number | object; +} \ No newline at end of file diff --git a/types/iview/icon.d.ts b/types/iview/icon.d.ts new file mode 100644 index 00000000..f6134417 --- /dev/null +++ b/types/iview/icon.d.ts @@ -0,0 +1,20 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Icon extends Vue { + /** + * 图标的名称 + */ + type?: string; + /** + * 图标的大小,单位是 px + */ + size?: number | string; + /** + * 图标的颜色 + */ + color?: string; +} \ No newline at end of file diff --git a/types/iview/index.d.ts b/types/iview/index.d.ts new file mode 100644 index 00000000..62152192 --- /dev/null +++ b/types/iview/index.d.ts @@ -0,0 +1,237 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode, PluginFunction } from "vue"; + +import { Affix } from "./affix"; +import { Alert } from "./alert"; +import { Anchor, AnchorLink } from "./anchor"; +import { AutoComplete } from "./auto-complete"; +import { Avatar } from "./avatar"; +import { BackTop } from "./back-top"; +import { Badge } from "./badge"; +import { Breadcrumb, BreadcrumbItem } from "./breadcrumb"; +import { Button, ButtonGroup } from "./button"; +import { Card } from "./card"; +import { Carousel } from "./carousel"; +import { Cascader } from "./cascader"; +import { Cell, CellGroup } from "./cell"; +import { Checkbox, CheckboxGroup } from "./checkbox"; +import { Circle } from "./circle"; +import { Collapse, CollapsePanel } from "./collapse"; +import { ColorPicker } from "./color-picker"; +import { DatePicker, DatePickerOptions } from "./date-picker"; +import { Divider } from "./divider"; +import { Dropdown, DropdownItem } from "./dropdown"; +import { Form, FormItem } from "./form"; +import { GridRow, GridCol } from "./grid"; +import { Icon } from "./icon"; +import { Input } from "./input"; +import { InputNumber } from "./input-number"; +import { Layout } from "./layout"; +import { LoadingBarInstance, LoadingBarConfig } from "./loading-bar"; +import { Menu, MenuItem, Submenu, MenuGroup } from "./menu"; +import { MessageInstance, MessageConfig } from "./message"; +import { Modal, ModalInstance, ModalConfig } from "./modal"; +import { NoticeInstance, NoticeConfig, NoticeGlobalConfig } from "./notice"; +import { Page } from "./page"; +import { Poptip } from "./poptip"; +import { Progress } from "./progress"; +import { Radio, RadioGroup } from "./radio"; +import { Rate } from "./rate"; +import { Scroll } from "./scroll"; +import { Select, SelectOption, SelectOptionGroup } from "./select"; +import { Spin } from "./spin"; +import { Split } from "./split"; +import { Steps, Step } from "./steps"; +import { Switch } from "./switch"; +import { Table, TableColumn, TableRenderCreateElementData, TableRenderCreateElementResult, TableColumnRenderParams, TableExportCsvParams } from "./table"; +import { Tabs, TabPane } from "./tabs"; +import { Tag } from "./tag"; +import { Time } from "./time"; +import { Timeline, TimelineItem } from "./timeline"; +import { TimePicker } from "./time-picker"; +import { Tooltip } from "./tooltip"; +import { Transfer } from "./transfer"; +import { Tree, TreeChild } from "./tree"; +import { Upload } from "./upload"; + +declare namespace IView { + type IAffix = Affix; + type IAlert = Alert; + type IAnchor = Anchor; + type IAnchorLink = AnchorLink; + type IAutoComplete = AutoComplete; + type IAvatar = Avatar; + type IBackTop = BackTop; + type IBadge = Badge; + type IBreadcrumb = Breadcrumb; + type IBreadcrumbItem = BreadcrumbItem; + type IButton = Button; + type IButtonGroup = ButtonGroup; + type ICard = Card; + type ICarousel = Carousel; + type ICascader = Cascader; + type ICell = Cell; + type ICellGroup = CellGroup; + type ICheckbox = Checkbox; + type ICheckboxGroup = CheckboxGroup; + type ICircle = Circle; + type ICollapse = Collapse; + type ICollapsePanel = CollapsePanel; + type IColorPicker = ColorPicker; + type IDatePicker = DatePicker; + type IDatePickerOptions = DatePickerOptions; + type IDivider = Divider; + type IDropdown = Dropdown; + type IDropdownItem = DropdownItem; + type IForm = Form; + type IFormItem = FormItem; + type IGridCol = GridCol; + type IGridRow = GridRow; + type IIcon = Icon; + type IInput = Input; + type IInputNumber = InputNumber; + type ILayout = Layout; + type ILoadingBarInstance = LoadingBarInstance; + type ILoadingBarConfig = LoadingBarConfig; + type IMenu = Menu; + type IMenuGroup = MenuGroup; + type IMenuItem = MenuItem; + type IMessageConfig = MessageConfig; + type IMessageInstance = MessageInstance; + type IModal = Modal; + type IModalConfig = ModalConfig; + type IModalInstance = ModalInstance; + type INoticeConfig = NoticeConfig; + type INoticeGlobalConfig = NoticeGlobalConfig; + type INoticeInstance = NoticeInstance; + type IPage = Page; + type IPoptip = Poptip; + type IProgress = Progress; + type IRadio = Radio; + type IRadioGroup = RadioGroup; + type IRate = Rate; + type IScroll = Scroll; + type ISelect = Select; + type ISelectOption = SelectOption; + type ISelectOptionGroup = SelectOptionGroup; + type ISpin = Spin; + type ISplit = Split; + type IStep = Step; + type ISteps = Steps; + type ISubmenu = Submenu; + type ISwitch = Switch; + type ITable = Table; + type ITableColumn = TableColumn; + type ITableColumnRenderParams = TableColumnRenderParams; + type ITableExportCsvParams = TableExportCsvParams; + type ITableRenderCreateElementData = TableRenderCreateElementData; + type ITableRenderCreateElementResult = TableRenderCreateElementResult; + type ITabPane = TabPane; + type ITabs = Tabs; + type ITag = Tag; + type ITime = Time; + type ITimeline = Timeline; + type ITimelineItem = TimelineItem; + type ITimePicker = TimePicker; + type ITooltip = Tooltip; + type ITransfer = Transfer; + type ITree = Tree; + type ITreeChild = TreeChild; + type IUpload = Upload; +} + +declare interface IView extends PluginFunction { + readonly IAffix: Affix; + readonly IAlert: Alert; + readonly IAnchor: Anchor; + readonly IAnchorLink: AnchorLink; + readonly IAutoComplete: AutoComplete; + readonly IAvatar: Avatar; + readonly IBackTop: BackTop; + readonly IBadge: Badge; + readonly IBreadcrumb: Breadcrumb; + readonly IBreadcrumbItem: BreadcrumbItem; + readonly IButton: Button; + readonly IButtonGroup: ButtonGroup; + readonly ICard: Card; + readonly ICarousel: Carousel; + readonly ICascader: Cascader; + readonly ICell: Cell; + readonly ICellGroup: CellGroup; + readonly ICheckbox: Checkbox; + readonly ICheckboxGroup: CheckboxGroup; + readonly ICircle: Circle; + readonly ICollapse: Collapse; + readonly ICollapsePanel: CollapsePanel; + readonly IColorPicker: ColorPicker; + readonly IDatePicker: DatePicker; + readonly IDatePickerOptions: DatePickerOptions; + readonly IDivider: Divider; + readonly IDropdown: Dropdown; + readonly IDropdownItem: DropdownItem; + readonly IForm: Form; + readonly IFormItem: FormItem; + readonly IGridCol: GridCol; + readonly IGridRow: GridRow; + readonly IIcon: Icon; + readonly IInput: Input; + readonly IInputNumber: InputNumber; + readonly ILayout: Layout; + readonly ILoadingBarInstance: LoadingBarInstance; + readonly ILoadingBarConfig: LoadingBarConfig; + readonly IMenu: Menu; + readonly IMenuGroup: MenuGroup; + readonly IMenuItem: MenuItem; + readonly IMessageConfig: MessageConfig; + readonly IMessageInstance: MessageInstance; + readonly IModal: Modal; + readonly IModalConfig: ModalConfig; + readonly IModalInstance: ModalInstance; + readonly INoticeConfig: NoticeConfig; + readonly INoticeGlobalConfig: NoticeGlobalConfig; + readonly INoticeInstance: NoticeInstance; + readonly IPage: Page; + readonly IPoptip: Poptip; + readonly IProgress: Progress; + readonly IRadio: Radio; + readonly IRadioGroup: RadioGroup; + readonly IRate: Rate; + readonly IScroll: Scroll; + readonly ISelect: Select; + readonly ISelectOption: SelectOption; + readonly ISelectOptionGroup: SelectOptionGroup; + readonly ISpin: Spin; + readonly ISplit: Split; + readonly IStep: Step; + readonly ISteps: Steps; + readonly ISubmenu: Submenu; + readonly ISwitch: Switch; + readonly ITable: Table; + readonly ITableColumn: TableColumn; + readonly ITableColumnRenderParams: TableColumnRenderParams; + readonly ITableExportCsvParams: TableExportCsvParams; + readonly ITableRenderCreateElementData: TableRenderCreateElementData; + readonly ITableRenderCreateElementResult: TableRenderCreateElementResult; + readonly ITabPane: TabPane; + readonly ITabs: Tabs; + readonly ITag: Tag; + readonly ITime: Time; + readonly ITimeline: Timeline; + readonly ITimelineItem: TimelineItem; + readonly ITimePicker: TimePicker; + readonly ITooltip: Tooltip; + readonly ITransfer: Transfer; + readonly ITree: Tree; + readonly ITreeChild: TreeChild; + readonly IUpload: Upload; +} + +export default IView; + +declare module 'iview/types/iview' { + const iView: IView; + export default iView; +} diff --git a/types/iview/input-number.d.ts b/types/iview/input-number.d.ts new file mode 100644 index 00000000..222d6bde --- /dev/null +++ b/types/iview/input-number.d.ts @@ -0,0 +1,75 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface InputNumber extends Vue { + /** + * 最大值,默认值Infinity + */ + max?: number; + /** + * 最小值,默认值-Infinity + */ + min?: number; + /** + * 当前值,可以使用 v-model 双向绑定数据,默认值1 + */ + value?: number; + /** + * 每次改变的步伐,可以是小数,默认值1 + */ + step?: number; + /** + * 输入框尺寸,可选值为large、small、default或者不填 + */ + size?: '' | 'large' | 'small' | 'default'; + /** + * 设置禁用状态,默认值false + */ + disabled?: boolean; + /** + * 输入框占位符 + * @default 请选择 + */ + placeholder?: string; + /** + * 指定输入框展示值的格式 + */ + formatter?: () => void; + /** + * 指定从 formatter 里转换回数字的方式,和 formatter 搭配使用 + */ + parser?: () => void; + /** + * 是否设置为只读 + * @default false + */ + readonly?: boolean; + /** + * 是否可编辑 + * @default true + */ + editable?: boolean; + /** + * 数值精度 + */ + precision?: number; + /** + * 给表单元素设置 id,详见 Form 用法。 + */ + 'element-id'?: string; + /** + * 数值改变时的回调,返回当前值,默认值当前值 + */ + $emit(eventName: 'on-change', value: number): this; + /** + * 聚焦时触发 + */ + $emit(eventName: 'on-focus', event: KeyboardEvent): this; + /** + * 失焦时触发 + */ + $emit(eventName: 'on-blur', event: KeyboardEvent): this; +} \ No newline at end of file diff --git a/types/iview/input.d.ts b/types/iview/input.d.ts new file mode 100644 index 00000000..760968c6 --- /dev/null +++ b/types/iview/input.d.ts @@ -0,0 +1,168 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Input extends Vue { + /** + * 输入框类型,可选值为 text、password、textarea、url、email、date + * @default text + */ + type?: 'text' | 'password' | 'textarea' | 'url' | 'email' | 'date'; + /** + * 绑定的值,可使用 v-model 双向绑定 + * @default 空 + */ + value?: string | number; + /** + * 输入框尺寸,可选值为large、small、default或者不设置 + */ + size?: '' | 'large' | 'small' | 'default'; + /** + * 占位文本 + */ + placeholder?: string; + /** + * 是否显示清空按钮 + * @default false + */ + clearable?: boolean; + /** + * 设置输入框为禁用状态 + * @default false + */ + disabled?: boolean; + /** + * 设置输入框为只读 + * @default false + */ + readonly?: boolean; + /** + * 最大输入长度 + */ + maxlength?: number; + /** + * 输入框尾部图标,仅在 text 类型下有效 + */ + icon?: string; + /** + * 输入框头部图标 + * @default false + */ + prefix?: string; + /** + * 输入框尾部图标 + * @default false + */ + suffix?: String; + /** + * 是否显示为搜索型输入框 + * @default false + */ + search?: boolean; + /** + * 开启 search 时可用,是否有确认按钮,可设为按钮文字 + * @default false + */ + 'enter-button'?: boolean | string; + /** + * 文本域默认行数,仅在 textarea 类型下有效 + * @default 2 + */ + rows?: number; + /** + * 自适应内容高度,仅在 textarea 类型下有效,可传入对象,如 { minRows: 2, maxRows: 6 } + * @default false + */ + autosize?: boolean | { minRows?: number, maxRows?: number }; + /** + * 将用户的输入转换为 number 类型 + * @default false + */ + number?: boolean; + /** + * 自动获取焦点 + * @default false + */ + autofocus?: boolean; + /** + * 原生的自动完成功能,可选值为 off 和 on,off + */ + autocomplete?: string; + /** + * 给表单元素设置 id,详见 Form 用法。 + */ + 'element-id'?: string; + /** + * 原生的 spellcheck 属性 + * @default false + */ + spellcheck?: boolean; + /** + * 原生的 wrap 属性,可选值为 hard 和 soft,仅在 textarea 下生效 + * @default soft + */ + wrap?: 'hard' | 'soft'; + /** + * 按下回车键时触发 + */ + $emit(eventName: 'on-enter'): this; + /** + * 设置 icon 属性后,点击图标时触发 + */ + $emit(eventName: 'on-click'): this; + /** + * 数据改变时触发 + */ + $emit(eventName: 'on-change', event: string): this; + /** + * 输入框聚焦时触发 + */ + $emit(eventName: 'on-focus'): this; + /** + * 输入框失去焦点时触发 + */ + $emit(eventName: 'on-blur'): this; + /** + * 原生的 keyup 事件 + */ + $emit(eventName: 'on-keyup', event: KeyboardEvent): this; + /** + * 原生的 keydown 事件 + */ + $emit(eventName: 'on-keydown', event: KeyboardEvent): this; + /** + * 原生的 keypress 事件 + */ + $emit(eventName: 'on-keypress', event: KeyboardEvent): this; + /** + * 开启 search 时可用,点击搜索或按下回车键时触发 + */ + $emit(eventName: 'on-search', value: string): this; + /** + * 手动聚焦输入框 + */ + focus(): void; + /** + * slot插槽对象 + */ + $slots: { + /** + * 前置内容,仅在 text 类型下有效 + */ + prepend: VNode[]; + /** + * 后置内容,仅在 text 类型下有效 + */ + append: VNode[]; + /** + * 输入框头部图标 + */ + prefix: VNode[]; + /** + * 输入框尾部图标 + */ + suffix: VNode[]; + }; +} \ No newline at end of file diff --git a/types/iview/iview.d.ts b/types/iview/iview.d.ts new file mode 100644 index 00000000..408519fa --- /dev/null +++ b/types/iview/iview.d.ts @@ -0,0 +1,4 @@ +declare module 'iview' { + const iView: any; + export default iView; +} \ No newline at end of file diff --git a/types/iview/layout.d.ts b/types/iview/layout.d.ts new file mode 100644 index 00000000..cadc4c45 --- /dev/null +++ b/types/iview/layout.d.ts @@ -0,0 +1,72 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Layout extends Vue { + /** + * 触发响应式布局的断点,可选值为xs,sm,md,lg,xl或xxl,若不设此属性则不会触发响应式布局。 + * { + * xs?: '480px', + * sm?: '768px', + * md?: '992px', + * lg?: '1200px', + * xl?: '1600px' + * } + */ + breakpoint?: string; + /** + * 侧边栏是否收起,可使用 v-model 双向绑定数据。 + * @default false + */ + value?: boolean; + /** + * 宽度 + * @default 200 + */ + width?: number; + /** + * 是否可收起,设为false后,默认触发器会隐藏,且响应式布局不会触发 + * @default false + */ + collapsible?: boolean; + /** + * 收缩宽度,设置为 0 会出现特殊 trigger + * @default 64 + */ + 'collapsed-width'?: number; + /** + * 隐藏默认触发器 + * @default false + */ + 'hide-trigger'?: boolean; + /** + * 是否默认收起,设置了collapsible后设置此属性侧边栏仍会收起。 + * @default false + */ + 'default-collapsed'?: boolean; + /** + * 改变侧边栏触发器箭头方向,和改变侧边栏收起方向,当Sider在右边时可以使用。 + * @default false + */ + 'reverse-arrow'?: boolean; + /** + * 展开-收起时的回调true/false + */ + $emit(eventName: 'on-collapse', []): this; + /** + * slot插槽对象 + */ + $slots: { + /** + * 自定义触发器 + * @default + */ + trigger: VNode[]; + }; + /** + * methods, 改变Sider展开-收起状态。 + */ + toggleCollapse(): void; +} \ No newline at end of file diff --git a/types/iview/loading-bar.d.ts b/types/iview/loading-bar.d.ts new file mode 100644 index 00000000..2111efa6 --- /dev/null +++ b/types/iview/loading-bar.d.ts @@ -0,0 +1,61 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface LoadingBarInstance { + /** + * 开始从 0 显示进度条,并自动加载进度 + */ + start(): void; + /** + * 结束进度条,自动补全剩余进度 + */ + finish(): void; + /** + * 以错误的类型结束进度条,自动补全剩余进度 + */ + error(): void; + /** + * 精确加载到指定的进度 + * @param percent 指定的进度百分比 + */ + update(percent?: number): void; + /** + * 全局配置 + * @param options 配置对象 + */ + config(options?: LoadingBarConfig): void; + /** + * 全局销毁 + */ + destroy(): void; +} + +export interface LoadingBarConfig { + /** + * 进度条的颜色,默认为 iView 主色 + * @default primary + */ + color?: string; + /** + * 失败时的进度条颜色,默认为 iView 主色 + * @default error + */ + failedColor?: string; + /** + * 进度条高度,单位 px + * @default 2 + */ + height?: number; +} + +declare module "vue/types/vue" { + interface Vue { + /** + * 加载进度条 + */ + $Loading?: LoadingBarInstance; + } +} \ No newline at end of file diff --git a/types/iview/menu.d.ts b/types/iview/menu.d.ts new file mode 100644 index 00000000..1a8cc7ec --- /dev/null +++ b/types/iview/menu.d.ts @@ -0,0 +1,102 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Menu extends Vue { + /** + * 菜单类型,可选值为 horizontal(水平) 和 vertical(垂直) + * @default vertical + */ + mode?: 'horizontal' | 'vertical'; + /** + * 主题,可选值为 light、dark、primary,其中 primary 只适用于 mode="horizontal" + * @default light + */ + theme?: 'light' | 'dark' | 'primary'; + /** + * 激活菜单的 name 值 + */ + 'active-name'?: string | number; + /** + * 展开的 Submenu 的 name 集合 + */ + 'open-names'?: string[] | number[]; + /** + * 是否开启手风琴模式,开启后每次至多展开一个子菜单 + * @default false + */ + accordion?: boolean; + /** + * 导航菜单的宽度,只在 mode="vertical" 时有效,如果使用 Col 等布局,建议设置为 auto + * @default 240px + */ + width?: string; + /** + * 选择菜单(MenuItem)时触发 + */ + $emit(eventName: 'on-select', name?: string | number): this; + /** + * 当 展开/收起 子菜单时触发 + * @default 当前展开的 Submenu 的 name 值数组 + */ + $emit(eventName: 'on-open-change', names: string[] | number[]): this; + /** + * 手动更新展开的子目录,注意要在 $nextTick 里调用 + */ + updateOpened(): void; + /** + * 手动更新当前选择项,注意要在 $nextTick 里调用 + */ + updateActiveName(): void; +} + +export interface MenuItem extends Vue { + /** + * 菜单项的唯一标识,必填 + */ + name?: string | number; + /** + * 跳转的链接,支持 vue-router 对象 + */ + to?: string | object; + /** + * 路由跳转时,开启 replace 将不会向 history 添加新记录 + * @default false + */ + replace?: boolean; + /** + * 相当于 a 链接的 target 属性 + * @default _self + */ + target?: '_blank' | '_self' | '_parent' | '_top'; +} + +export interface Submenu extends Vue { + /** + * 子菜单的唯一标识,必填 + */ + name?: string | number; + /** + * slot插槽对象 + */ + $slots: { + /** + * 菜单项 + */ + '': VNode[]; + /** + * 子菜单标题 + */ + title: VNode[]; + }; +} + +export interface MenuGroup extends Vue { + /** + * 分组标题 + * @default 空 + */ + title?: string; +} \ No newline at end of file diff --git a/types/iview/message.d.ts b/types/iview/message.d.ts new file mode 100644 index 00000000..a49659ab --- /dev/null +++ b/types/iview/message.d.ts @@ -0,0 +1,84 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode, CreateElement } from "vue"; + +export interface MessageInstance { + /** + * 消息 + * @param config MessageConfig为相关配置,string为待显示的内容 + */ + info(config?: MessageConfig | string): void; + /** + * 成功 + * @param config MessageConfig为相关配置,string为待显示的内容 + */ + success(config?: MessageConfig | string): void; + /** + * 警告 + * @param config MessageConfig为相关配置,string为待显示的内容 + */ + warning(config?: MessageConfig | string): void; + /** + * 错误 + * @param config MessageConfig为相关配置,string为待显示的内容 + */ + error(config?: MessageConfig | string): void; + /** + * 配置 + * @param config MessageConfig为相关配置,string为待显示的内容 + */ + loading(options?: MessageConfig | string): void; + /** + * 配置 + * @param config MessageConfig为相关配置,string为待显示的内容 + */ + config(options?: MessageConfig): void; + /** + * 销毁 + */ + destroy(): void; +} + +export interface MessageConfig { + /** + * 提示内容 + */ + content?: string; + /** + * 自定义描述内容,使用 Vue 的 Render 函数 + */ + render?: (h: CreateElement) => VNode; + /** + * 关闭时的回调 + */ + onClose?: () => void; + /** + * 页面是否可以滚动 + * @default false + */ + closable?: boolean; + /** + * 提示组件距离顶端的距离,单位像素 + * @default 24 + */ + top?: number; + /** + * 默认自动关闭的延时,单位秒 + * @default 1.5 + */ + duration?: number; +} + +declare module "vue/types/vue" { + interface Vue { + /** + * 全局提示 + */ + $Message?: MessageInstance; + } +} + + + diff --git a/types/iview/modal.d.ts b/types/iview/modal.d.ts new file mode 100644 index 00000000..ed8a50fe --- /dev/null +++ b/types/iview/modal.d.ts @@ -0,0 +1,218 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Modal { + /** + * 对话框是否显示,可使用 v-model 双向绑定数据。 + * @default false + */ + value?: boolean; + /** + * 对话框标题,如果使用 slot 自定义了页头,则 title 无效 + */ + title?: string; + /** + * 是否显示右上角的关闭按钮,关闭后 Esc 按键也将关闭, + * @default true + */ + closable?: boolean; + /** + * 是否允许点击遮罩层关闭 + * @default true + */ + 'mask-closable'?: boolean; + /** + * 点击确定按钮时,确定按钮是否显示 loading 状态,开启则需手动设置visible来关闭对话框, + * @default false + */ + loading?: boolean; + /** + * 页面是否可以滚动 + * @default false + */ + scrollable?: boolean; + /** + * 是否全屏显示 + * @default false + */ + fullscreen?: boolean; + /** + * 是否可以拖拽移动 + * @default false + */ + draggable?: boolean; + /** + * 是否显示遮罩层,开启 draggable 时,强制不显示 + * @default true + */ + mask?: boolean; + /** + * 确定按钮文字 + * @default 确定 + */ + 'ok-text'?: string; + /** + * 取消按钮文字 + * @default 取消 + */ + 'cancel-text'?: string; + /** + * 对话框宽度,单位 px。 + * 对话框的宽度是响应式的,当屏幕尺寸小于 768px 时,宽度会变为自动auto, + * @default 520 + */ + width?: number | string; + /** + * 不显示底部 + * @default false + */ + 'footer-hide'?: boolean; + /** + * 设置浮层样式,调整浮层位置等,该属性设置的是.ivu-modal的样式 + */ + style?: object; + /** + * 设置对话框容器.ivu-modal-wrap的类名,可辅助实现垂直居中等自定义效果 + */ + 'class-name'?: string; + /** + * 自定义显示动画,第一项是模态框,第二项是背景, + * @default ['ease', 'fade'] + */ + 'transition-names'?: Array; + /** + * 是否将弹层放置于 body 内,默认值true + * @default true + */ + transfer?: boolean; + /** + * 点击确定的回调 + */ + $emit(eventName: 'on-ok'): this; + /** + * 开关变化时触发,返回当前的状态 + */ + $emit(eventName: 'on-cancel'): this; + /** + * 开关变化时触发,返回当前的状态 + */ + $emit(eventName: 'on-visible-change', visible: boolean): this; + /** + * slot插槽对象 + */ + $slots: { + /** + * 对话框主体内容 + */ + '': VNode[]; + /** + * 自定义页头 + */ + header: VNode[]; + /** + * 自定义页脚内容 + */ + footer: VNode[]; + /** + * 自定义右上角关闭内容 + */ + close: VNode[]; + }; +} + +export interface ModalInstance { + /** + * 消息 + * @param config ModalConfig为相关配置,string为待显示的内容 + */ + info(config?: ModalConfig | string): void; + /** + * 成功 + * @param config ModalConfig为相关配置,string为待显示的内容 + */ + success(config?: ModalConfig | string): void; + /** + * 警告 + * @param config ModalConfig为相关配置,string为待显示的内容 + */ + warning(config?: ModalConfig | string): void; + /** + * 错误 + * @param config ModalConfig为相关配置,string为待显示的内容 + */ + error(config?: ModalConfig | string): void; + /** + * 对话框 + * @param config ModalConfig为相关配置,string为待显示的内容 + */ + confirm(config?: ModalConfig | string): void; + /** + * 移除 + */ + remove(): void; +} + +export interface ModalConfig { + /** + * 标题或者Element选择器字符串 + */ + title?: string; + /** + * 内容或者Element选择器字符串 + */ + content?: string; + /** + * 自定义内容,使用后不再限制类型, content 也无效。 + */ + render?: () => void; + /** + * 宽度,单位 px + * @default 416 + */ + width?: number | string; + /** + * 确定按钮的文字 + * @default 确定 + */ + okText?: string; + /** + * 取消按钮的文字,只在Modal.confirm()下有效 + * @default 取消 + */ + cancelText?: string; + /** + * 点击确定按钮时,确定按钮是否显示 loading 状态,开启则需手动调用Modal.remove()来关闭对话框 + * @default false + */ + loading?: boolean; + /** + * 页面是否可以滚动 + * @default false + */ + scrollable?: boolean; + /** + * 页面是否可以滚动 + * @default false + */ + closable?: boolean; + /** + * 点击确定的回调 + */ + onOk?: () => void; + /** + * 点击取消的回调,只在Modal.confirm()下有效 + */ + onCancel?: () => void; +} + +declare module "vue/types/vue" { + interface Vue { + /** + * 对话框 + */ + $Modal?: ModalInstance; + } +} \ No newline at end of file diff --git a/types/iview/notice.d.ts b/types/iview/notice.d.ts new file mode 100644 index 00000000..808b1f6e --- /dev/null +++ b/types/iview/notice.d.ts @@ -0,0 +1,92 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode, CreateElement } from "vue"; + +export interface NoticeInstance { + /** + * 打开 + * @param config NoticeConfig为相关配置,string为待显示的内容 + */ + open(config?: NoticeConfig | string): void; + /** + * 信息 + * @param config NoticeConfig为相关配置,string为待显示的内容 + */ + info(config?: NoticeConfig | string): void; + /** + * 成功 + * @param config NoticeConfig为相关配置,string为待显示的内容 + */ + success(config?: NoticeConfig | string): void; + /** + * 警告 + * @param config NoticeConfig为相关配置,string为待显示的内容 + */ + warning(config?: NoticeConfig | string): void; + /** + * 错误 + * @param config NoticeConfig为相关配置,string为待显示的内容 + */ + error(config?: NoticeConfig): void; + /** + * 全局配置 + */ + config(options?: NoticeGlobalConfig): void; + /** + * 全局关闭某个通知 + */ + close(name?: string): void; + /** + * 全局销毁 + */ + destroy(): void; +} + +export interface NoticeConfig { + /** + * 通知提醒的标题 + */ + title?: string; + /** + * 通知提醒的内容,为空或不填时,自动应用仅标题模式下的样式 + */ + desc?: string; + /** + * 自定义描述内容,使用 Vue 的 Render 函数 + */ + render?: (h: CreateElement) => VNode; + /** + * 自动关闭的延时,单位秒,不关闭可以写 0 默认4.5 + */ + duration?: number; + /** + * 当前通知的唯一标识 + */ + name?: string; + /** + * 关闭时的回调 + */ + onClose?: Function; +} + +export interface NoticeGlobalConfig { + /** + * 通知组件距离顶端的距离,单位像素 默认24 + */ + top?: number; + /** + * 默认自动关闭的延时,单位秒 默认4.5 + */ + duration?: number; +} + +declare module "vue/types/vue" { + interface Vue { + /** + * 通知提醒 + */ + $Notice?: NoticeInstance; + } +} \ No newline at end of file diff --git a/types/iview/page.d.ts b/types/iview/page.d.ts new file mode 100644 index 00000000..2e8cd7c0 --- /dev/null +++ b/types/iview/page.d.ts @@ -0,0 +1,99 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Page extends Vue { + /** + * 当前页码,支持 .sync 修饰符 + * @default 1 + */ + current?: number; + /** + * 数据总数 + * @default 0 + */ + total?: number; + /** + * 每页条数 + * @default 10 + */ + 'page-size'?: number; + /** + * 每页条数切换的配置 + * @default [10, 20, 30, 40] + */ + 'page-size-opts'?: number[]; + /** + * 条数切换弹窗的展开方向,可选值为 bottom 和 top + * @default bottom + */ + placement?: string; + /** + * 可选值为small(迷你版)或不填(默认) + */ + size?: string; + /** + * 简洁版 + * @default false + */ + simple?: boolean; + /** + * 显示总数 + * @default false + */ + 'show-total'?: boolean; + /** + * 显示电梯,可以快速切换到某一页 + * @default false + */ + 'show-elevator'?: boolean; + /** + * 显示分页,用来改变page-size + * @default false + */ + 'show-sizer'?: boolean; + /** + * 自定义 class 名称 + */ + 'class-name'?: string; + /** + * 自定义 style 样式 + */ + styles?: object; + /** + * 是否将弹层放置于 body 内, + * 在 Tabs、带有 fixed 的 Table 列内使用时,建议添加此属性, + * 它将不受父级样式影响,从而达到更好的效果 + * @default false + */ + transfer?: boolean; + /** + * 替代图标显示的上一页文字 + */ + 'prev-text'?: string; + /** + * 替代图标显示的下一页文字 + */ + 'next-text'?: string; + /** + * 页码改变的回调,返回改变后的页码 + * @param pageNum 页码 + */ + $emit(eventName: 'on-change', pageNum: number): this; + /** + * 切换每页条数时的回调,返回切换后的每页条数 + * @param pageSize 每页条数 + */ + $emit(eventName: 'on-page-size-change', pageSize: number): this; + /** + * slot插槽对象 + */ + $slots: { + /** + * 自定义显示总数的内容 + */ + '': VNode[]; + }; +} \ No newline at end of file diff --git a/types/iview/poptip.d.ts b/types/iview/poptip.d.ts new file mode 100644 index 00000000..58d321b9 --- /dev/null +++ b/types/iview/poptip.d.ts @@ -0,0 +1,123 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Poptip extends Vue { + /** + * 触发方式,可选值为hover(悬停)click(点击)focus(聚焦), + * 在 confirm 模式下,只有 click 有效 + * @default click + */ + trigger?: string; + /** + * 显示的标题 + */ + title?: string | number; + /** + * 显示的正文内容,只在非 confirm 模式下有效\ + * @default 空 + */ + 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 版本开始支持自动识别 + * @default top + */ + 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; + /** + * 是否开启对话框模式 + * @default false + */ + confirm?: boolean; + /** + * 确定按钮的文字,只在 confirm 模式下有效 + * @default 确定 + */ + 'ok-text'?: string; + /** + * 取消按钮的文字,只在 confirm 模式下有效 + * @default 取消 + */ + 'cancel-text'?: string; + /** + * 是否将弹层放置于 body 内,在 Tabs、带有 fixed 的 Table 列内使用时, + * 建议添加此属性,它将不受父级样式影响,从而达到更好的效果 + * @default false + */ + transfer?: boolean; + /** + * 给 Poptip 设置 class-name,在使用 transfer 时会很有用 + * @default false + */ + 'popper-class'?: string; + /** + * 开启后,超出指定宽度文本将自动换行,并两端对齐 + * @default false + */ + 'word-wrap'?: boolean; + /** + * 自定义间距值 + * @default 8px 16px + */ + padding?: string; + /** + * 出现位置的偏移量 + * @default false + */ + offset?: string; + /** + * 自定义 popper.js 的配置项,具体配置见 popper.js 文档 + * @default { + modifiers: { + computeStyle:{ + gpuAcceleration: false, + }, + preventOverflow :{ + boundariesElement: 'window' + } + } + } + */ + options?: object; + /** + * 在提示框显示时触发 + */ + $emit(eventName: 'on-popper-show'): this; + /** + * 在提示框消失时触发 + */ + $emit(eventName: 'on-popper-hide'): this; + /** + * 点击确定的回调,只在 confirm 模式下有效 + */ + $emit(eventName: 'on-ok'): this; + /** + * 点击取消的回调,只在 confirm 模式下有效 + */ + $emit(eventName: 'on-cancel'): this; + /** + * slot插槽对象 + */ + $slots: { + /** + * 主体内容 + */ + '': VNode[]; + /** + * 提示框标题,定义此 slot 时,会覆盖 props title + */ + title: VNode[]; + /** + * 提示框内容,定义此 slot 时,会覆盖 props content,只在非 confirm 模式下有效 + */ + content: VNode[]; + } +} \ No newline at end of file diff --git a/types/iview/progress.d.ts b/types/iview/progress.d.ts new file mode 100644 index 00000000..5d4748f3 --- /dev/null +++ b/types/iview/progress.d.ts @@ -0,0 +1,47 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Progress extends Vue { + /** + * 百分比 + * @default 0 + */ + percent?: number; + /** + * 状态,可选值为normal、active、wrong、success + * @default normal + */ + status?: 'normal'|'active'|'wrong'|'success'; + /** + * 进度条的线宽,单位 px + * @default 10 + */ + 'stroke-width'?: number; + /** + * 隐藏数值或状态图标 + * @default false + */ + 'hide-info'?: boolean; + /** + * 是否在垂直方向显示 + * @default false + */ + vertical?: boolean; + /** + * 已完成的分段百分比 + * @default 0 + */ + 'success-percent'?: number; + /** + * slot插槽对象 + */ + $slots: { + /** + * 自定义显示状态内容 + */ + '': VNode[]; + }; +} diff --git a/types/iview/radio.d.ts b/types/iview/radio.d.ts new file mode 100644 index 00000000..32c1104c --- /dev/null +++ b/types/iview/radio.d.ts @@ -0,0 +1,64 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Radio extends Vue { + /** + * 只在单独使用时有效。可以使用 v-model 双向绑定数据 + * @default false + */ + value?: boolean; + /** + * 只在组合使用时有效。指定当前选项的 value 值,组合会自动判断当前选择的项目 + */ + label?: string | number; + /** + * 是否禁用当前项 + * @default false + */ + disabled?: boolean; + /** + * 单选框的尺寸,可选值为 large、small、default 或者不设置 + */ + size?: '' | 'large' | 'small' | 'default'; + /** + * 选中时的值,当使用类似 1 和 0 来判断是否选中时会很有用 + * @default true + */ + 'true-value'?: string | number | boolean; + /** + * 没有选中时的值,当使用类似 1 和 0 来判断是否选中时会很有用 + * @default false + */ + 'false-value'?: string | number | boolean; + /** + * 在选项状态发生改变时触发,返回当前状态。通过修改外部的数据改变时不会触发 + */ + $emit(eventName: 'on-change', arg: string | number | boolean): this; +} + +export interface RadioGroup extends Vue { + /** + * 指定当前选中的项目数据。可以使用 v-model 双向绑定数据 + */ + value?: string | number; + /** + * 可选值为 button 或不填,为 button 时使用按钮样式 + */ + type?: string; + /** + * 尺寸,可选值为large、small、default或者不设置 + */ + size?: '' | 'large' | 'small' | 'default'; + /** + * 是否垂直排列,按钮样式下无效 + * @default false + */ + vertical?: boolean; + /** + * 在选项状态发生改变时触发,返回当前选中的项。通过修改外部的数据改变时不会触发 + */ + $emit(eventName: 'on-change', ...args: Array): this; +} diff --git a/types/iview/rate.d.ts b/types/iview/rate.d.ts new file mode 100644 index 00000000..09b36887 --- /dev/null +++ b/types/iview/rate.d.ts @@ -0,0 +1,54 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Rate extends Vue { + /** + * star总数 + * @default 5 + */ + count?: number; + /** + * 当前 star 数,可以使用 v-model 双向绑定数据 + * @default 0 + */ + value?: number; + /** + * 是否允许半选 + * @default false + */ + 'allow-half'?: boolean; + /** + * 是否只读,无法进行交互 + * @default false + */ + disabled?: boolean; + /** + * 是否显示提示文字 + * @default false + */ + 'show-text'?: boolean; + /** + * 是否可以取消选择 + * @default false + */ + clearable?: boolean; + /** + * 自定义字符 + */ + character?: string; + /** + * 使用图标 + */ + icon?: string; + /** + * 使用自定义图标 + */ + 'custom-icon'?: string; + /** + * 评分改变时触发 + */ + $emit(eventName: 'on-change', value: number): this; +} \ No newline at end of file diff --git a/types/iview/scroll.d.ts b/types/iview/scroll.d.ts new file mode 100644 index 00000000..dae6ccf4 --- /dev/null +++ b/types/iview/scroll.d.ts @@ -0,0 +1,35 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Scroll extends Vue { + /** + * 滚动区域的高度,单位像素 + * @default 300 + */ + height?: string | number; + /** + * 加载中的文案 + * @default 加载中 + */ + 'loading-text'?: string; + /** + * 滚动至顶部时触发,需返回Promise + */ + 'on-reach-top'?: () => void; + /** + * 滚动至底部时触发,需返回Promise + */ + 'on-reach-bottom'?: () => void; + /** + * 滚动至顶部或底部时触发,需返回Promise + */ + 'on-reach-edge'?: () => void; + /** + * 从边缘到触发回调的距离。如果是负的,回调将在到达边缘之前触发。值最好在 24 以下。 + * @default [20, 20] + */ + 'distance-to-edge'?: number | number[]; +} \ No newline at end of file diff --git a/types/iview/select.d.ts b/types/iview/select.d.ts new file mode 100644 index 00000000..fc555bda --- /dev/null +++ b/types/iview/select.d.ts @@ -0,0 +1,141 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Select extends Vue { + /** + * 指定选中项目的 value 值,可以使用 v-model 双向绑定数据。 + * 单选时只接受 String 或 Number,多选时只接受 Array + * @default 空 + */ + value?: string | number | string[] | number[]; + /** + * 是否支持多选 + * @default false + */ + multiple?: boolean; + /** + * 是否禁用 + * @default false + */ + disabled?: boolean; + /** + * 是否可以清空选项,只在单选时有效 + * @default false + */ + clearable?: boolean; + /** + * 是否支持搜索 + * @default false + */ + filterable?: boolean; + /** + * 是否使用远程搜索 + * @default false + */ + remote?: boolean; + /** + * 远程搜索的方法 + */ + 'remote-method'?: () => void; + /** + * 当前是否正在远程搜索 + * @default false + */ + loading?: boolean; + /** + * 远程搜索中的文字提示 + * @default 加载中 + */ + 'loading-text'?: string; + /** + * 仅在 remote 模式下,初始化时使用。因为仅通过 value 无法得知选项的 label,需手动设置。默认值空 + */ + label?: string | number | string[] | number[]; + /** + * 选择框大小,可选值为large、small、default或者不填 + */ + size?: '' | 'large' | 'small' | 'default'; + /** + * 选择框默认文字 + * @default 请选择 + */ + placeholder?: string; + /** + * 当下拉列表为空时显示的内容 + * @default 无匹配数据 + */ + 'not-found-text'?: string; + /** + * 在返回选项时,是否将 label 和 value 一并返回,默认只返回 + * @default false + */ + 'label-in-value'?: boolean; + /** + * 弹窗的展开方向,可选值为 bottom 和 top + * @default bottom + */ + placement?: 'bottom' | 'top'; + /** + * 是否将弹层放置于 body 内,在 Tabs、带有 fixed 的 Table 列内使用时, + * 建议添加此属性,它将不受父级样式影响,从而达到更好的效果 + * @default false + */ + transfer?: boolean; + /** + * 给表单元素设置 id,详见 Form 用法。 + */ + 'element-id'?: string; + /** + * 选中的Option变化时触发,默认返回 value,如需返回 label,详见 label-in-value 属性 当前选中项 + */ + $emit(eventName: 'on-change'): this; + /** + * 搜索词改变时触发,query + */ + $emit(eventName: 'on-query-change', query: string): this; + /** + * 搜索词改变时触发,query + */ + $emit(eventName: 'on-clear'): this; + /** + * 搜索词改变时触发,query + */ + $emit(eventName: 'on-open-change', params: boolean): this; + /** + * 设置搜索词,为空时清空,仅在 filterable="true" 时有效 + */ + setQuery(query: string): void; + /** + * 清空单选项,仅在 clearable="true" 时有效 + */ + clearSingleSelect(): void; +} + +export interface SelectOption extends Vue { + /** + * 选项值,默认根据此属性值进行筛选,必填 + */ + value?: string | number; + /** + * 选项显示的内容,默认会读取 slot,无 slot 时,优先读取该 label 值, + * 无 label 时,读取 value。当选中时,选择器会显示 label 为已选文案。 + * 大部分情况不需要配置此项,直接写入 slot 即可,在自定义选项时,该属性非常有用。 + */ + label?: string; + /** + * 是否禁用当前项 + * @default false + */ + disabled?: boolean; +} + +export interface SelectOptionGroup extends Vue { + /** + * 分组的组名 + * @default 空 + */ + label?: string; +} \ No newline at end of file diff --git a/types/iview/slider.d.ts b/types/iview/slider.d.ts new file mode 100644 index 00000000..767069a5 --- /dev/null +++ b/types/iview/slider.d.ts @@ -0,0 +1,70 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Slider extends Vue { + /** + * 滑块选定的值,可以使用 v-model 双向绑定数据。普通模式下,数据格式为数字, + * 在双滑块模式下,数据格式为长度是2的数组,且每项都为数字, + * @default 0 + */ + value?: number | number[]; + /** + * 最小值 + * @default 0 + */ + min?: number; + /** + * 最大值 + * @default 100 + */ + max?: number; + /** + * 步长,取值建议能被(max - min)整除 + * @default 1 + */ + step?: number; + /** + * 是否禁用滑块 + * @default false + */ + disabled?: boolean; + /** + * 是否开启双滑块模式 + * @default false + */ + range?: boolean; + /** + * 是否显示数字输入框,仅在单滑块模式下有效 + * @default false + */ + 'show-input'?: boolean; + /** + * 是否显示间断点,建议在 step 不密集时使用 + * @default false + */ + 'show-stops'?: boolean; + /** + * 提示的显示控制,可选值为 hover(悬停,默认)、always(总是可见)、never(不可见) + * @default false + */ + 'show-tip'?: boolean; + /** + * 会把当前值传给 tip-format,并在 Tooltip 中显示 tip-format 的返回值,若为 null,则隐藏 Tooltip + */ + 'tip-format'?: (value?: number | number[]) => void; + /** + * 数字输入框的尺寸,可选值为large、small、default或者不填,仅在开启 show-input 时有效 + */ + 'input-size'?: '' | 'large' | 'small' | 'default'; + /** + * 在松开滑动时触发,返回当前的选值,在滑动过程中不会触发 + */ + $emit(eventName: 'on-change', value: number | number[]): this; + /** + * 滑动条数据变化时触发,返回当前的选值,在滑动过程中实时触发 + */ + $emit(eventName: 'on-input', value: number | number[]): this; +} \ No newline at end of file diff --git a/types/iview/spin.d.ts b/types/iview/spin.d.ts new file mode 100644 index 00000000..50a8ce41 --- /dev/null +++ b/types/iview/spin.d.ts @@ -0,0 +1,26 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Spin extends Vue { + /** + * Spin尺寸,可选值为large和small或者不设置 + */ + size?: 'large' | 'small'; + /** + * 是否固定,需要父级有relative或absolute + * @default false + */ + fix?: boolean; + /** + * slot插槽对象 + */ + $slots: { + /** + * 自定义 Spin 的内容,设置slot后,默认的样式不生效 + */ + '': VNode[]; + }; +} \ No newline at end of file diff --git a/types/iview/split.d.ts b/types/iview/split.d.ts new file mode 100644 index 00000000..067456ce --- /dev/null +++ b/types/iview/split.d.ts @@ -0,0 +1,68 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Split extends Vue { + /** + * 面板位置,可以是 0~1 代表百分比,或具体数值的像素,可用 v-model 双向绑定 + * @default 0.5 + */ + value?: number | string; + /** + * 类型,可选值为 horizontal 或 vertical + * @default horizontal + */ + mode?: 'horizontal' | 'vertical'; + /** + * 最小阈值 + * @default 40px + */ + min?: number | string; + /** + * 最大阈值 + * @default 40px + */ + max?: number | string; + /** + * 拖拽开始 - + * @default false + */ + $emit(eventName: 'on-move-start', []): this; + /** + * 拖拽中 + */ + $emit(eventName: 'on-moving', []): this; + /** + * 拖拽结束 + * @default false + */ + $emit(eventName: 'on-move-end', []): this; + /** + * slot插槽对象 + */ + $slots: { + /** + * mode 为 horizontal 时可用,左边面板 + * @default false + */ + left: VNode[]; + /** + * mode 为 horizontal 时可用,右边面板 + */ + right: VNode[]; + /** + * mode 为 vertical 时可用,上边面板 + */ + top: VNode[]; + /** + * mode 为 vertical 时可用,下边面板 + */ + bottom: VNode[]; + /** + * 自定义分割拖拽节点 + */ + trigger: VNode[]; + } +} \ No newline at end of file diff --git a/types/iview/steps.d.ts b/types/iview/steps.d.ts new file mode 100644 index 00000000..8e8ad5b7 --- /dev/null +++ b/types/iview/steps.d.ts @@ -0,0 +1,48 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Steps extends Vue { + /** + * 当前步骤,从 0 开始计数 + * @default 0 + */ + current?: number; + /** + * 当前步骤的状态,可选值为wait、process、finish、error + * @default process + */ + status?: 'wait' | 'process' | 'finish' | 'error'; + /** + * 步骤条的尺寸,可选值为small或者不写 + */ + size?: '' | 'small'; + /** + * 步骤条的方向,可选值为horizontal(水平)或vertical(垂直) + * @default horizontal + */ + direction?: 'horizontal' | 'vertical'; +} + +export interface Step extends Vue { + /** + * 步骤的状态,可选值为wait、process、finish、error,不设置时自动判断 + * @default process + */ + status?: 'wait' | 'process' | 'finish' | 'error'; + /** + * 标题 + * @default 空 + */ + title?: string; + /** + * 步骤的详细描述,可选 + */ + content?: string; + /** + * 步骤的图标,可选 + */ + icon?: string; +} \ No newline at end of file diff --git a/types/iview/switch.d.ts b/types/iview/switch.d.ts new file mode 100644 index 00000000..b64744f8 --- /dev/null +++ b/types/iview/switch.d.ts @@ -0,0 +1,54 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Switch extends Vue { + /** + * 指定当前是否选中,可以使用 v-model 双向绑定数据 + * @default false + */ + value?: boolean; + /** + * 开关的尺寸,可选值为large、small、default或者不写。建议开关如果使用了2个汉字的文字,使用 large。 + */ + size?: '' | 'large' | 'small' | 'default'; + /** + * 禁用开关 + * @default false + */ + disabled?: boolean; + /** + * 选中时的值,当使用类似 1 和 0 来判断是否选中时会很有用 + * @default true + */ + 'true-value'?: string | number | boolean; + /** + * 没有选中时的值,当使用类似 1 和 0 来判断是否选中时会很有用 + * @default false + */ + 'false-value'?: string | number | boolean; + /** + * 加载中的开关 + * @default false + */ + loading?: boolean; + /** + * 开关变化时触发,返回当前的状态 + */ + $emit(eventName: 'on-change', value: boolean): this; + /** + * slot插槽对象 + */ + $slots: { + /** + * 自定义显示打开时的内容 + */ + open: VNode[]; + /** + * 自定义显示关闭时的内容 + */ + close: VNode[]; + }; +} \ No newline at end of file diff --git a/types/iview/table.d.ts b/types/iview/table.d.ts new file mode 100644 index 00000000..eb11b9c2 --- /dev/null +++ b/types/iview/table.d.ts @@ -0,0 +1,419 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Table extends Vue { + /** + * 显示的结构化数据,其中,字段 cellClassName 用于设置任意单元格的样式名称, + * 因此数据不能使用该字段,详见示例特定样式。 + * @default [] + */ + data?: object[]; + /** + * 表格列的配置描述,具体项见后文 + * @default [] + */ + columns?: object[]; + /** + * 是否显示间隔斑马纹 + * @default false + */ + stripe?: boolean; + /** + * 是否显示纵向边框 + * @default false + */ + border?: boolean; + /** + * 是否显示表头 + * @default true + */ + 'show-header'?: boolean; + /** + * 表格宽度,单位 px + * @default 自动 + */ + width?: number | string; + /** + * 表格高度,单位 px,设置后,如果表格内容大于此值,会固定表头 + */ + height?: number | string; + /** + * 表格是否加载中 + * @default false + */ + loading?: boolean; + /** + * 禁用鼠标悬停时的高亮 + * @default false + */ + 'disabled-hover'?: boolean; + /** + * 是否支持高亮选中的行,即单选 + * @default false + */ + 'highlight-row'?: boolean; + /** + * 行的 className 的回调方法,传入参数: + * row:当前行数据 + * index:当前行的索引 + */ + 'row-class-name'?: (row?: object, index?: number) => void; + /** + * 表格尺寸,可选值为 large、small、default 或者不填 + */ + size?: string; + /** + * 数据为空时显示的提示内容 + * @default 暂无数据 + */ + 'no-data-text'?: string; + /** + * 筛选数据为空时显示的提示内容 + * @default 暂无筛选结果 + */ + 'no-filtered-data-text'?: string; + /** + * 开启 highlight-row 后有效,当表格的当前行发生变化的时候会触发 + * currentRow:当前高亮行的数据 + * oldCurrentRow:上一次高亮的数据 + */ + $emit(eventName: 'on-current-change', currentRow: object, oldCurrentRow: object): this; + /** + * 在多选模式下有效,选中某一项时触发 + * selection:已选项数据 + * row:刚选择的项数据 + */ + $emit(eventName: 'on-select', selection: object[], row: object): this; + /** + * 在多选模式下有效,取消选中某一项时触发 + * selection:已选项数据 + * row:取消选择的项数据 + */ + $emit(eventName: 'on-select-cancel', selection: object[], row: object): this; + /** + * 在多选模式下有效,点击全选时触发 + * selection:已选项数据 + */ + $emit(eventName: 'on-select-all', selection: object[]): this; + /** + * 在多选模式下有效,只要选中项发生变化时就会触发 + * selection:已选项数据 + */ + $emit(eventName: 'on-selection-change', selection: object[]): this; + /** + * 排序时有效,当点击排序时触发 + * column:当前列数据 + * key:排序依据的指标 + * order:排序的顺序,值为 asc 或 desc + */ + $emit(eventName: 'on-sort-change', column?: object, key?: string, order?: 'asc' | 'desc'): this; + /** + * 筛选时有效,筛选条件发生变化时触发 当前列数据 + */ + $emit(eventName: 'on-filter-change', value: any): this; + /** + * 单击某一行时触发 + * currentRow:当前行的数据 + * index?: 当前行的索引 + */ + $emit(eventName: 'on-row-click', currentRow: object, index: number): this; + /** + * 双击某一行时触发 + * currentRow:当前行的数据 + * index?: 当前行的索引 + */ + $emit(eventName: 'on-row-dblclick', currentRow: object, index: number): this; + /** + * 展开或收起某一行时触发 + * row:当前行的数据 + * status:当前的状态 + */ + $emit(eventName: 'on-expand', row: object, status: string): this; + /** + * 导出数据 + */ + exportCsv(params: TableExportCsvParams): void; + /** + * 执行改变大小重绘table + */ + handleResize(): void; + /** + * 清除高亮项,仅在开启 highlight-row 时可用 + */ + clearCurrentRow(): void; + /** + * slot插槽对象 + */ + $slots: { + /** + * 表头 + */ + header: VNode[]; + /** + * 页脚 + */ + footer: VNode[]; + /** + * 加载中 + */ + loading: VNode[]; + }; +} + +export interface TableColumn { + /** + * 列类型,可选值为 index、selection、expand、html + */ + type?: 'index' | 'selection' | 'expand' | 'html'; + /** + * 列头显示文字 + * @default # + */ + title?: string; + /** + * 对应列内容的字段名 + */ + key?: string; + /** + * 列宽 + */ + width?: number; + /** + * 最小列宽 + */ + minWidth?: number; + /** + * 最大列宽 + */ + maxWidth?: number; + /** + * 对齐方式,可选值为 left 左对齐、right 右对齐和 center 居中对齐,默认 left + * @default left + */ + align?: 'left' | 'right' | 'center'; + /** + * 列的样式名称 + */ + className?: string; + /** + * 列是否固定在左侧或者右侧,可选值为 left 左侧和 right 右侧 + */ + fixed?: 'left' | 'right'; + /** + * 开启后,文本将不换行,超出部分显示为省略号 + * @default false + */ + ellipsis?: boolean; + /** + * 开启后,文本将不换行,超出部分显示为省略号,并用 Tooltip 组件显示完整内容 + * @default false + */ + tooltip?: boolean; + /** + * 自定义渲染列,使用 Vue 的 Render 函数。 + * 传入两个参数,第一个是 h,第二个为对象,包含 row、column 和 index, + * 分别指当前行数据,当前列数据,当前行索引,详见示例。 + * 学习 Render 函数的内容 从 rc.18 版本开始,我们将不再支持旧的用法。旧的 render 函数已被废弃。 + */ + render?: (h?: + ( + el?: string | object | Function, + data?: string | TableRenderCreateElementData | TableRenderCreateElementResult | Array, + vnode?: string | TableRenderCreateElementResult[] + ) => TableRenderCreateElementResult, + params?: TableColumnRenderParams + ) => TableRenderCreateElementResult; + /** + * 自定义列头显示内容,传入参数有两个,column 和 index,分别为当前列数据和当前列索引,不支持渲染自定义组件 + */ + renderHeader?: (h?: + ( + el?: string | object | Function, + data?: string | TableRenderCreateElementData | TableRenderCreateElementResult | Array, + vnode?: string | TableRenderCreateElementResult[] + ) => TableRenderCreateElementResult, + params?: TableColumnRenderHeadParams + ) => TableRenderCreateElementResult; + /** + * 对应列是否可以排序,如果设置为 custom,则代表用户希望远程排序, + * 需要监听 Table 的 on- sort - change 事件,默认false + * @default false + */ + sortable?: boolean; + /** + * 自定义排序使用的方法,接收三个参数 a 、 b 和 type, + * 当设置 sortable?: true 时有效。type 值为 asc 和 desc + */ + sortMethod?: (a: any, b: any, type: 'asc' | 'desc') => void; + /** + * 设置初始化排序。值为 asc 和 desc + */ + sortType?: 'asc' | 'desc'; + /** + * 过滤数据的选项,格式为数组,数组中每项包含 label 和 value 属性,使用过滤,必须同时配置filterMethod + */ + filters?: { label: string, value: string | number | boolean }[]; + /** + * 数据过滤使用的方法,如果是多选的筛选项,对每一条数据会执行多次,任意一次返回 true 就会显示 + */ + filterMethod?: () => void; + /** + * 数据过滤的选项是否多选 + * @default true + */ + filterMultiple?: boolean; + /** + * 在初始化时使用过滤,数组,值为需要过滤的 value 集合 + */ + filteredValue?: (string | number | boolean)[]; + /** + * 使用远程过滤 + */ + filterRemote?: () => void; + /** + * 表头分组 + */ + children?: object[]; +} + +export interface TableRenderCreateElementData { + /** + * 和`v-bind:class`一样的 API + */ + 'class'?: object; + /** + * 和`v-bind:style`一样的 API + */ + style?: object; + /** + * 正常的 HTML 特性 + */ + attrs?: object, + /** + * 组件 props + */ + props?: object; + /** + * DOM 属性 + */ + domProps?: object; + /** + * 事件监听器基于 "on" + * 所以不再支持如 v-on?:keyup.enter 修饰器 + * 需要手动匹配 keyCode。 + */ + on?: object; + /** + * 仅对于组件,用于监听原生事件,而不是组件使用 vm.$emit 触发的事件。 + */ + nativeOn?: object; + /** + * 自定义指令. 注意事项:不能对绑定的旧值设值 + * Vue 会为您持续追踨 + */ + directives?: object[]; + /** + * 如果子组件有定义 slot 的名称 + */ + slot?: string; + /** + * 其他特殊顶层属性,myKey + */ + key?: string; + /** + * myRef + */ + ref?: string +} + +export interface TableColumnRenderParams { + /** + * 当前行数据 + */ + row?: object; + /** + * 当前列数据 + */ + column?: object; + /** + * 当前行索引 + */ + index?: number; +} + +export interface TableRenderCreateElementResult { + child?: object; + children?: Array; + componentInstance?: object; + componentOptions?: object; + context?: object; + data?: object; + elm?: object; + functionalContext?: object; + isCloned?: boolean; + isComment?: boolean; + isOnce?: boolean; + isRootInsert?: boolean; + isStatic?: boolean; + key?: object; + ns?: object; + parent?: object; + raw?: boolean; + tag?: string; + text?: object; +} + +export interface TableColumnRenderHeadParams { + /** + * 当前列数据 + */ + column?: object; + /** + * 当前行索引 + */ + index?: number; +} + +export interface TableExportCsvParams { + /** + * 文件名,默认为 table.csv + */ + filename?: string; + /** + * 是否导出为原始数据,默认为 true + */ + original?: boolean; + /** + * 不显示表头,默认为 false + */ + noHeader?: boolean; + /** + * 自定义导出的列数据 + */ + columns?: any[]; + /** + * 自定义导出的行数据 + */ + data?: any[]; + /** + * 添加此函数后,不会下载,而是返回数据 + */ + callback?: () => void; + /** + * 数据分隔符,默认是逗号(,) + * @default , + */ + separator?: string; + /** + * 每项数据是否加引号 + * @default false + */ + quoted?: boolean; +} + + + + diff --git a/types/iview/tabs.d.ts b/types/iview/tabs.d.ts new file mode 100644 index 00000000..2bd112fc --- /dev/null +++ b/types/iview/tabs.d.ts @@ -0,0 +1,81 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Tabs extends Vue { + /** + * 当前激活 tab 面板的 name,可以使用 v-model 双向绑定数据 + * @default 默认为第一项的 name + */ + value?: string; + /** + * 页签的基本样式,可选值为 line 和 card + * @default line + */ + type?: 'line' | 'card'; + /** + * 尺寸,可选值为 default 和 small,仅在 type="line" 时有效 + * @default default + */ + size?: 'default' | 'small'; + /** + * 是否可以关闭页签,仅在 type="card" 时有效 + * @default false + */ + closable?: boolean; + /** + * 是否使用 CSS3 动画 + * @default true + */ + animated?: boolean; + /** + * Tabs 内的表单类组件是否自动获得焦点 + * @default false + */ + 'capture-focus'?: boolean; + /** + * tab 被点击时触发 + */ + $emit(eventName: 'on-click', name: string): this; + /** + * tab 被关闭时触发 + */ + $emit(eventName: 'on-tab-remove', name: string): this; + /** + * slot插槽对象 + */ + $slots: { + /** + * 附加内容 + */ + extra: VNode[]; + }; +} + +export interface TabPane extends Vue { + /** + * 用于标识当前面板,对应 value,默认为其索引值 + */ + name?: string | number; + /** + * 选项卡头显示文字,支持 Render 函数。 + * @default 空 + */ + label?: string | (() => void); + /** + * 选项卡图标 + */ + icon?: string; + /** + * 是否禁用该选项卡 + * @default false + */ + disabled?: boolean; + /** + * 是否可以关闭页签,仅在 type="card" 时有效 + * @default null + */ + closable?: boolean; +} \ No newline at end of file diff --git a/types/iview/tag.d.ts b/types/iview/tag.d.ts new file mode 100644 index 00000000..dbf9160c --- /dev/null +++ b/types/iview/tag.d.ts @@ -0,0 +1,48 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Tag extends Vue { + /** + * 标签是否可以关闭 + * @default false + */ + closable?: boolean + /** + * 标签是否可以选择 + * @default false + */ + checkable?: boolean; + /** + * 标签的选中状态 + * @default true + */ + checked?: boolean; + /** + * 标签的样式类型,可选值为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'; + /** + * 当前标签的名称,使用 v-for,并支持关闭时,会比较有用 + */ + name?: string | number; + /** + * 是否在出现和消失时使用渐变的动画,动画时长可能会引起占位的闪烁 + * @default true + */ + fade?: boolean; + /** + * 关闭时触发 + */ + $emit(eventName: 'on-close', event: object, name: string): this; +} \ No newline at end of file diff --git a/types/iview/time-picker.d.ts b/types/iview/time-picker.d.ts new file mode 100644 index 00000000..943053c3 --- /dev/null +++ b/types/iview/time-picker.d.ts @@ -0,0 +1,169 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface TimePicker extends Vue { + /** + * 显示类型,可选值为 time、timerange + * @default time + */ + type?: 'time' | 'timerange'; + /** + * 时间,可以是 JavaScript 的 Date,例如 new Date(),也可以是标准的时间格式,点击右边查看 + * 注意:value 使用 v-model 时,值是 Date 类型,可以配合 @on-change 使用 + * 名称 说明 示例 + * yyyy 年份(四位) 2016 + * yy 年份(两位) 16 + * MM 月份(两位) 01 + * M 月份(一位) 1 + * MMMM 月份(英文) January + * MMM 月份(英文简写) Jan + * dd 日期(两位) 01 + * d 日期(一位) 1 + * Do 日期(简写) 1st + * DD 星期(两位) 00 + * D 星期(一位) 0 + * dddd 星期(英文) Monday + * ddd 星期(英文简写) Mon + * HH 小时(24小时制两位) 01 + * H 小时(24小时制一位) 1 + * hh 小时(12小时制两位) 01 + * h 小时(12小时制一位) 1 + * mm 分钟(两位) 01 + * m 分钟(一位) 1 + * ss 秒钟(两位) 01 + * s 秒钟(一位) 1 + * SSS 毫秒(三位) 019 + * SS 毫秒(两位) 01 + * S 毫秒(一位) 1 + * A 上午与下午(大写) AM/PM + * a 上午与下午(小写) am/pm + * ZZ 时区 +0800 + */ + value?: Date; + /** + * 展示的时间格式 + * @default HH:mm:ss + * 名称 说明 示例 + * yyyy 年份(四位) 2016 + * yy 年份(两位) 16 + * MM 月份(两位) 01 + * M 月份(一位) 1 + * MMMM 月份(英文) January + * MMM 月份(英文简写) Jan + * dd 日期(两位) 01 + * d 日期(一位) 1 + * Do 日期(简写) 1st + * DD 星期(两位) 00 + * D 星期(一位) 0 + * dddd 星期(英文) Monday + * ddd 星期(英文简写) Mon + * HH 小时(24小时制两位) 01 + * H 小时(24小时制一位) 1 + * hh 小时(12小时制两位) 01 + * h 小时(12小时制一位) 1 + * mm 分钟(两位) 01 + * m 分钟(一位) 1 + * ss 秒钟(两位) 01 + * s 秒钟(一位) 1 + * SSS 毫秒(三位) 019 + * SS 毫秒(两位) 01 + * S 毫秒(一位) 1 + * A 上午与下午(大写) AM/PM + * a 上午与下午(小写) am/pm + * ZZ 时区 +0800 + */ + format?: string; + /** + * 下拉列表的时间间隔,数组的三项分别对应小时、分钟、秒。 + * 例如设置为 [1, 15] 时,分钟会显示:00、15、30、45。 + * @default [] + */ + steps?: any[]; + /** + * 时间选择器出现的位置,可选值为 + * top,top-start,top-end + * bottom,bottom-start,bottom-end + * left,left-start,left-end + * right,right-start,right-end + * @default bottom-start + */ + placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; + /** + * 占位文本 + * @default 空 + */ + placeholder?: string; + /** + * 是否显示底部控制栏 + * @default false + */ + confirm?: boolean; + /** + * 手动控制时间选择器的显示状态,true 为显示,false 为收起。 + * 使用该属性后,选择器不会主动关闭。建议配合 slot 及 confirm 和相关事件一起使用, + * @default null + */ + open?: boolean; + /** + * 尺寸,可选值为large、small、default或者不设置 + */ + size?: '' | 'large' | 'small' | 'default'; + /** + * 是否禁用选择器 + * @default false + */ + disabled?: boolean; + /** + * 是否显示清除按钮 + * @default true + */ + clearable?: boolean; + /** + * 完全只读,开启后不会弹出选择器,只在没有设置 open 属性下生效 + * @default false + */ + readonly?: boolean; + /** + * 文本框是否可以输入,只在没有使用 slot 时有效 + * @default true + */ + editable?: boolean; + /** + * 是否将弹层放置于 body 内,在 Tabs、带有 fixed 的 Table 列内使用时, + 建议添加此属性,它将不受父级样式影响,从而达到更好的效果 + * @default false + */ + transfer?: boolean; + /** + * 给表单元素设置 id,详见 Form 用法。 + */ + 'element-id'?: boolean; + /** + * 时间发生变化时触发 已经格式化后的时间,比如 09:41:00 + */ + $emit(eventName: 'on-change', value: string): this; + /** + * 弹出浮层和关闭浮层时触发 + */ + $emit(eventName: 'on-open-change', value: boolean): this; + /** + * 点击确定按钮时触发 + */ + $emit(eventName: 'on-ok'): this; + /** + * 在清空日期时触发 + */ + $emit(eventName: 'on-clear'): this; + /** + * slot插槽对象 + */ + $slots: { + /** + * 自定义选择器的显示内容,建议与 open 等参数一起使用,详见示例 + */ + '': VNode[]; + }; +} \ No newline at end of file diff --git a/types/iview/time.ts b/types/iview/time.ts new file mode 100644 index 00000000..7de152ed --- /dev/null +++ b/types/iview/time.ts @@ -0,0 +1,27 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Time extends Vue { + /** + * 需要对比的时间,可以是时间戳或 Date 类型 + */ + time?: number |Date |string; + /** + * 类型,可选值为 relative、date 或 datetime + * @default relative + */ + type?: 'relative'|'date'|'datetime'; + /** + * 自动更新的间隔,单位:秒 + * @default 60 + */ + interval?: number; + /** + * 填写该值,点击会定位锚点 + * @default false + */ + hash?: string; +} \ No newline at end of file diff --git a/types/iview/timeline.d.ts b/types/iview/timeline.d.ts new file mode 100644 index 00000000..fa6ce3f6 --- /dev/null +++ b/types/iview/timeline.d.ts @@ -0,0 +1,34 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Timeline extends Vue { + /** + * 指定是否最后一个节点为幽灵节点 + * @default false + */ + pending?: boolean; +} + +export interface TimelineItem extends Vue { + /** + * 圆圈颜色,可选值为blue、red、green,或自定义色值 + * @default blue + */ + color?: 'blue' | 'red' | 'green' | string; + /** + * slot插槽对象 + */ + $slots: { + /** + * 基本内容 + */ + '': VNode[]; + /** + * 自定义时间轴点内容 + */ + dot: VNode[]; + }; +} \ No newline at end of file diff --git a/types/iview/tooltip.d.ts b/types/iview/tooltip.d.ts new file mode 100644 index 00000000..3dff6994 --- /dev/null +++ b/types/iview/tooltip.d.ts @@ -0,0 +1,91 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Tooltip extends Vue { + /** + * 显示的内容 + * @default 空 + */ + 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 版本开始支持自动识别 + * @default bottom + */ + placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; + /** + * 是否禁用提示框 + * @default false + */ + disabled?: boolean; + /** + * 延迟显示,单位毫秒 + * @default 0 + */ + delay?: number; + /** + * 是否总是可见 + * @default false + */ + always?: boolean; + /** + * 主题,可选值为 dark 或 light + * @default dark + */ + theme?: string; + /** + * 最大宽度,超出最大值后,文本将自动换行,并两端对齐 + */ + 'max-width'?: string|number; + /** + * 出现位置的偏移量 + * @default 0 + */ + offset?: number; + /** + * 是否将弹层放置于 body 内,在 Tabs、带有 fixed 的 Table 列内使用时, + * 建议添加此属性,它将不受父级样式影响,从而达到更好的效果 + * @default false + */ + transfer?: boolean; + /** + * 出现位置的偏移量 + * @default { + modifiers: { + computeStyle:{ + gpuAcceleration: false, + }, + preventOverflow :{ + boundariesElement: 'window' + } + } + } + */ + options?: object; + /** + * 在提示框显示时触发 + */ + $emit(eventName: 'on-popper-show'): this; + /** + * 在提示框消失时触发 + */ + $emit(eventName: 'on-popper-hide'): this; + /** + * slot插槽对象 + */ + $slots: { + /** + * 主体内容 + */ + '': VNode[]; + /** + * 提示框的内容,定义此 slot 时,会覆盖 props content。 + */ + content: VNode[]; + }; +} \ No newline at end of file diff --git a/types/iview/transfer.d.ts b/types/iview/transfer.d.ts new file mode 100644 index 00000000..9ec98b96 --- /dev/null +++ b/types/iview/transfer.d.ts @@ -0,0 +1,80 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Transfer extends Vue { + /** + * 数据源,其中的数据将会被渲染到左边一栏中,targetKeys 中指定的除外。 + * @default [] + */ + data?: object[]; + /** + * 显示在右侧框数据的key集合 + * @default [] + */ + targetKeys?: string[]; + /** + * 每行数据渲染函数,该函数的入参为 data 中的项 + * value?: 默认显示label,没有时显示key + */ + 'render-format'?: (value?: string) => void; + /** + * 设置哪些项应该被选中 + * @default [] + */ + 'selected-keys'?: string[]; + /** + * 两个穿梭框的自定义样式 + * @default {} + */ + 'list-style'?: object; + /** + * 标题集合,顺序从左至右 Array + * @default ['源列表', '目的列表'] + */ + titles?: string[]; + /** + * 操作文案集合,顺序从上至下 + * @default [] + */ + operations?: object[]; + /** + * 是否显示搜索框 + * @default false + */ + filterable?: object[]; + /** + * 搜索框的占位 + * @default 请输入搜索内容 + */ + 'filter-placeholder'?: string; + /** + * 自定义搜索函数,入参为 data 和 query,data 为项,query 为当前输入的搜索词 + * 默认搜索label + */ + 'filter-method'?: (value?: string) => void; + /** + * 当列表为空时显示的内容 + * @default 列表为空 + */ + 'not-found-text'?: string; + /** + * 选项在两栏之间转移时的回调函数 + */ + $emit(eventName: 'on-change', targetKeys: string[], direction: string, moveKeys: string[]): this; + /** + * 选项在两栏之间转移时的回调函数 + */ + $emit(eventName: 'on-selected-change', sourceSelectedKeys: string[], targetSelectedKeys: string[]): this; + /** + * slot插槽对象 + */ + $slots: { + /** + * 自定义底部内容 + */ + '': VNode[]; + }; +} \ No newline at end of file diff --git a/types/iview/tree.d.ts b/types/iview/tree.d.ts new file mode 100644 index 00000000..c8640a1d --- /dev/null +++ b/types/iview/tree.d.ts @@ -0,0 +1,103 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Tree extends Vue { + /** + * 可嵌套的节点属性的数组,生成 tree 的数据 + */ + data?: TreeChild[]; + /** + * 是否支持多选 + * @default false + */ + multiple?: boolean; + /** + * 是否显示多选框 + * @default false + */ + 'show-checkbox'?: boolean; + /** + * 没有数据时的提示 + * @default 暂无数据 + */ + 'empty-text'?: string; + /** + * 异步加载数据的方法 + */ + 'load-data'?: () => void; + /** + * 自定义渲染内容 + */ + render?: () => void; + /** + * 定义子节点键 + * @default children + */ + 'children-key'?:string; + /** + * 点击树节点时触发 + * @default 当前已选中的节点数组 + */ + $emit(eventName: 'on-select-change', value: TreeChild[]): this; + /** + * 点击复选框时触发 + * @default 当前已勾选节点的数组 + */ + $emit(eventName: 'on-check-change', value: TreeChild[]): this; + /** + * 展开和收起子列表时触发 + * @default 当前节点的数据 + */ + $emit(eventName: 'on-toggle-expand', value: TreeChild): this; + /** + * 获取被勾选的节点 + */ + getCheckedNodes(): void; + /** + * 获取被选中的节点 + */ + getSelectedNodes(): void; +} + +export interface TreeChild extends Vue { + /** + * 标题 + */ + title?: string; + /** + * 是否展开直子节点 + * @default false + */ + expand?: boolean; + /** + * 禁掉响应 + * @default false + */ + disabled?: boolean; + /** + * 禁掉checkbox + * @default false + */ + disableCheckbox?: boolean; + /** + * 是否选中子节点 + * @default false + */ + selected?: boolean; + /** + * 是否勾选(如果勾选,子节点也会全部勾选) + * @default false + */ + checked?: boolean; + /** + * 子节点属性数组 + */ + children?: TreeChild[]; + /** + * 自定义当前节点渲染内容,见示例 + */ + render(): void; +} \ No newline at end of file diff --git a/types/iview/upload.d.ts b/types/iview/upload.d.ts new file mode 100644 index 00000000..94305167 --- /dev/null +++ b/types/iview/upload.d.ts @@ -0,0 +1,130 @@ +// Type definitions for iview 3.0.0 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from "vue"; + +export interface Upload extends Vue { + /** + * 上传的地址,必填 + */ + action?: string; + /** + * 设置上传的请求头部 + * @default {} + */ + headers?: object; + /** + * 是否支持多选文件 + * @default false + */ + multiple?: boolean; + /** + * 是否支持粘贴上传文件 + * @default false + */ + paste?: boolean; + /** + * 上传时附带的额外参数 + */ + data?: object; + /** + * 上传的文件字段名 + * @default file + */ + name?: string; + /** + * 支持发送 cookie 凭证信息 + * @default false + */ + 'with-credentials'?: boolean; + /** + * 是否显示已上传文件列表 + * @default true + */ + 'show-upload-list'?: boolean; + /** + * 上传控件的类型,可选值为 select(点击选择),drag(支持拖拽) + * @default select + */ + type?: 'select' | 'drag'; + /** + * 接受上传的文件类型 + */ + accept?: string; + /** + * 支持的文件类型,与 accept 不同的是, + * format 是识别文件的后缀名, + * accept 为 input 标签原生的 accept 属性, + * 会在选择文件时过滤,可以两者结合使用, + * @default [] + */ + format?: string[]; + /** + * 文件大小限制,单位 kb + */ + 'max-size'?: number; + /** + * 上传文件之前的钩子,参数为上传的文件,若返回 false 或者 Promise 则停止上传 + */ + 'before-upload'?: Function; + /** + * 文件上传时的钩子,返回字段为 event, file, fileList + */ + 'on-progress'?: Function; + /** + * 文件上传成功时的钩子,返回字段为 response, file, fileList + */ + 'on-success'?: Function; + /** + * 文件上传失败时的钩子,返回字段为 error, file, fileList + */ + 'on-error'?: Function; + /** + * 点击已上传的文件链接时的钩子,返回字段为 file, 可以通过 file.response 拿到服务端返回数据 + */ + 'on-preview'?: Function; + /** + * 文件列表移除文件时的钩子,返回字段为 file, fileList + */ + 'on-remove'?: Function; + /** + * 文件格式验证失败时的钩子,返回字段为 file, fileList + */ + 'on-format-error'?: Function; + /** + * 文件超出指定大小限制时的钩子,返回字段为 file, fileList + */ + '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'?: string[]; + /** + * 清空已上传的文件列表 + */ + 'clearFiles'(): void; + /** + * slot插槽对象 + */ + $slots: { + /** + * 触发上传组件的控件 + */ + '': VNode[]; + /** + * 辅助提示内容 + */ + tip: VNode[]; + }; +} \ No newline at end of file From 414730dde3fbbd777ffe45c2b56c5caf3c855c0b Mon Sep 17 00:00:00 2001 From: yangd Date: Thu, 30 Aug 2018 13:27:15 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=AE=8C=E6=88=90d.ts=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E7=9A=84=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/webpack.dist.prod.config.js | 6 +- package.json | 4 +- types/{iview => }/affix.d.ts | 4 +- types/{iview => }/alert.d.ts | 4 +- types/{iview => }/anchor.d.ts | 6 +- types/{iview => }/auto-complete.d.ts | 4 +- types/{iview => }/avatar.d.ts | 4 +- types/{iview => }/back-top.d.ts | 4 +- types/{iview => }/badge.d.ts | 4 +- types/{iview => }/breadcrumb.d.ts | 6 +- types/{iview => }/button.d.ts | 6 +- types/{iview => }/card.d.ts | 4 +- types/{iview => }/carousel.d.ts | 4 +- types/{iview => }/cascader.d.ts | 4 +- types/{iview => }/cell.d.ts | 6 +- types/{iview => }/checkbox.d.ts | 6 +- types/{iview => }/circle.d.ts | 4 +- types/{iview => }/collapse.d.ts | 6 +- types/{iview => }/color-picker.d.ts | 4 +- types/{iview => }/date-picker.d.ts | 6 +- types/{iview => }/divider.d.ts | 4 +- types/{iview => }/dropdown.d.ts | 6 +- types/{iview => }/form.d.ts | 6 +- types/{iview => }/grid.d.ts | 6 +- types/{iview => }/icon.d.ts | 4 +- types/index.d.ts | 10 ++ types/{iview => }/input-number.d.ts | 4 +- types/{iview => }/input.d.ts | 4 +- types/iview.components.d.ts | 143 ++++++++++++++++ types/iview.d.ts | 6 + types/iview/index.d.ts | 237 --------------------------- types/iview/iview.d.ts | 4 - types/{iview => }/layout.d.ts | 4 +- types/{iview => }/loading-bar.d.ts | 6 +- types/{iview => }/menu.d.ts | 10 +- types/{iview => }/message.d.ts | 6 +- types/{iview => }/modal.d.ts | 8 +- types/{iview => }/notice.d.ts | 8 +- types/{iview => }/page.d.ts | 4 +- types/{iview => }/poptip.d.ts | 4 +- types/{iview => }/progress.d.ts | 4 +- types/{iview => }/radio.d.ts | 6 +- types/{iview => }/rate.d.ts | 4 +- types/{iview => }/scroll.d.ts | 4 +- types/{iview => }/select.d.ts | 8 +- types/{iview => }/slider.d.ts | 4 +- types/{iview => }/spin.d.ts | 4 +- types/{iview => }/split.d.ts | 4 +- types/{iview => }/steps.d.ts | 6 +- types/{iview => }/switch.d.ts | 4 +- types/{iview => }/table.d.ts | 16 +- types/{iview => }/tabs.d.ts | 6 +- types/{iview => }/tag.d.ts | 4 +- types/{iview => }/time-picker.d.ts | 4 +- types/{iview => }/time.ts | 4 +- types/{iview => }/timeline.d.ts | 6 +- types/{iview => }/tooltip.d.ts | 4 +- types/{iview => }/transfer.d.ts | 4 +- types/{iview => }/tree.d.ts | 6 +- types/{iview => }/upload.d.ts | 4 +- yarn.lock | 49 +++++- 61 files changed, 353 insertions(+), 382 deletions(-) rename types/{iview => }/affix.d.ts (86%) rename types/{iview => }/alert.d.ts (91%) rename types/{iview => }/anchor.d.ts (90%) rename types/{iview => }/auto-complete.d.ts (95%) rename types/{iview => }/avatar.d.ts (88%) rename types/{iview => }/back-top.d.ts (88%) rename types/{iview => }/badge.d.ts (94%) rename types/{iview => }/breadcrumb.d.ts (80%) rename types/{iview => }/button.d.ts (93%) rename types/{iview => }/card.d.ts (92%) rename types/{iview => }/carousel.d.ts (94%) rename types/{iview => }/cascader.d.ts (96%) rename types/{iview => }/cell.d.ts (91%) rename types/{iview => }/checkbox.d.ts (93%) rename types/{iview => }/circle.d.ts (93%) rename types/{iview => }/collapse.d.ts (88%) rename types/{iview => }/color-picker.d.ts (93%) rename types/{iview => }/date-picker.d.ts (97%) rename types/{iview => }/divider.d.ts (86%) rename types/{iview => }/dropdown.d.ts (93%) rename types/{iview => }/form.d.ts (94%) rename types/{iview => }/grid.d.ts (93%) rename types/{iview => }/icon.d.ts (81%) create mode 100644 types/index.d.ts rename types/{iview => }/input-number.d.ts (94%) rename types/{iview => }/input.d.ts (97%) create mode 100644 types/iview.components.d.ts create mode 100644 types/iview.d.ts delete mode 100644 types/iview/index.d.ts delete mode 100644 types/iview/iview.d.ts rename types/{iview => }/layout.d.ts (95%) rename types/{iview => }/loading-bar.d.ts (90%) rename types/{iview => }/menu.d.ts (91%) rename types/{iview => }/message.d.ts (93%) rename types/{iview => }/modal.d.ts (97%) rename types/{iview => }/notice.d.ts (92%) rename types/{iview => }/page.d.ts (96%) rename types/{iview => }/poptip.d.ts (97%) rename types/{iview => }/progress.d.ts (91%) rename types/{iview => }/radio.d.ts (93%) rename types/{iview => }/rate.d.ts (92%) rename types/{iview => }/scroll.d.ts (91%) rename types/{iview => }/select.d.ts (95%) rename types/{iview => }/slider.d.ts (96%) rename types/{iview => }/spin.d.ts (87%) rename types/{iview => }/split.d.ts (94%) rename types/{iview => }/steps.d.ts (89%) rename types/{iview => }/switch.d.ts (94%) rename types/{iview => }/table.d.ts (96%) rename types/{iview => }/tabs.d.ts (93%) rename types/{iview => }/tag.d.ts (94%) rename types/{iview => }/time-picker.d.ts (98%) rename types/{iview => }/time.ts (88%) rename types/{iview => }/timeline.d.ts (81%) rename types/{iview => }/tooltip.d.ts (96%) rename types/{iview => }/transfer.d.ts (95%) rename types/{iview => }/tree.d.ts (94%) rename types/{iview => }/upload.d.ts (97%) diff --git a/build/webpack.dist.prod.config.js b/build/webpack.dist.prod.config.js index a821976a..656f49f1 100644 --- a/build/webpack.dist.prod.config.js +++ b/build/webpack.dist.prod.config.js @@ -4,6 +4,7 @@ const merge = require('webpack-merge'); const webpackBaseConfig = require('./webpack.base.config.js'); const CompressionPlugin = require('compression-webpack-plugin'); const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); process.env.NODE_ENV = 'production'; @@ -43,6 +44,9 @@ module.exports = merge(webpackBaseConfig, { test: /\.(js|css)$/, threshold: 10240, minRatio: 0.8 - }) + }), + new CopyWebpackPlugin([{ + from: __dirname + '/../types' + }]) ] }); diff --git a/package.json b/package.json index 61ab949f..555126a8 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "framework" ], "main": "dist/iview.js", + "typings": "types/index.d.ts", "files": [ "dist", "src" @@ -111,7 +112,8 @@ "vue-template-compiler": "^2.5.16", "webpack": "^3.11.0", "webpack-dev-server": "^2.11.1", - "webpack-merge": "^3.0.0" + "webpack-merge": "^3.0.0", + "copy-webpack-plugin": "^4.5.2" }, "engines": { "node": ">=8.9.1", diff --git a/types/iview/affix.d.ts b/types/affix.d.ts similarity index 86% rename from types/iview/affix.d.ts rename to types/affix.d.ts index b5b020b0..a712a3a6 100644 --- a/types/iview/affix.d.ts +++ b/types/affix.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Affix extends Vue { +export declare class Affix extends Vue { /** * 距离窗口顶部达到指定偏移量后触发 * @default 0 diff --git a/types/iview/alert.d.ts b/types/alert.d.ts similarity index 91% rename from types/iview/alert.d.ts rename to types/alert.d.ts index ffaf36e8..77121c58 100644 --- a/types/iview/alert.d.ts +++ b/types/alert.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Alert extends Vue { +export declare class Alert extends Vue { /** * 警告提示样式,可选值为info、success、warning、error * @default info diff --git a/types/iview/anchor.d.ts b/types/anchor.d.ts similarity index 90% rename from types/iview/anchor.d.ts rename to types/anchor.d.ts index d1071b3d..7607ebcd 100644 --- a/types/iview/anchor.d.ts +++ b/types/anchor.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Anchor extends Vue { +export declare class Anchor extends Vue { /** * 固定模式 * @default true @@ -48,7 +48,7 @@ export interface Anchor extends Vue { $emit(eventName: 'on-change', []): this; } -export interface AnchorLink extends Vue { +export declare class AnchorLink extends Vue { /** * 锚点链接 * @default diff --git a/types/iview/auto-complete.d.ts b/types/auto-complete.d.ts similarity index 95% rename from types/iview/auto-complete.d.ts rename to types/auto-complete.d.ts index 40183a27..c87a37b5 100644 --- a/types/iview/auto-complete.d.ts +++ b/types/auto-complete.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface AutoComplete extends Vue { +export declare class AutoComplete extends Vue { /** * 绑定的值,可使用 v-model 双向绑定 */ diff --git a/types/iview/avatar.d.ts b/types/avatar.d.ts similarity index 88% rename from types/iview/avatar.d.ts rename to types/avatar.d.ts index dfa37203..e62e53c3 100644 --- a/types/iview/avatar.d.ts +++ b/types/avatar.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Avatar extends Vue { +export declare class Avatar extends Vue { /** * 指定头像的形状,可选值为 circle、square * @default circle diff --git a/types/iview/back-top.d.ts b/types/back-top.d.ts similarity index 88% rename from types/iview/back-top.d.ts rename to types/back-top.d.ts index 28a2f881..7f2bdaa3 100644 --- a/types/iview/back-top.d.ts +++ b/types/back-top.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface BackTop extends Vue { +export declare class BackTop extends Vue { /** * 页面滚动高度达到该值时才显示BackTop组件 * @default 400 diff --git a/types/iview/badge.d.ts b/types/badge.d.ts similarity index 94% rename from types/iview/badge.d.ts rename to types/badge.d.ts index 2be4658d..2c8edc37 100644 --- a/types/iview/badge.d.ts +++ b/types/badge.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Badge extends Vue { +export declare class Badge extends Vue { /** * 显示的数字,大于overflowCount时,显示${overflowCount}+,为 0 时隐藏 */ diff --git a/types/iview/breadcrumb.d.ts b/types/breadcrumb.d.ts similarity index 80% rename from types/iview/breadcrumb.d.ts rename to types/breadcrumb.d.ts index 6491a107..f7af8b2f 100644 --- a/types/iview/breadcrumb.d.ts +++ b/types/breadcrumb.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Breadcrumb extends Vue { +export declare class Breadcrumb extends Vue { /** * 自定义分隔符 * @default / @@ -12,7 +12,7 @@ export interface Breadcrumb extends Vue { separator?: string; } -export interface BreadcrumbItem extends Vue { +export declare class BreadcrumbItem extends Vue { /** * 链接,不传则没有链接 */ diff --git a/types/iview/button.d.ts b/types/button.d.ts similarity index 93% rename from types/iview/button.d.ts rename to types/button.d.ts index 9a994dad..28859b2e 100644 --- a/types/iview/button.d.ts +++ b/types/button.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Button extends Vue { +export declare class Button extends Vue { /** * 按钮类型,可选值为 default、primary、dashed、text、info、success、warning、error或者不设置 * @default default @@ -68,7 +68,7 @@ export interface Button extends Vue { target?: '_blank' | '_self' | '_parent' | '_top'; } -export interface ButtonGroup extends Vue { +export declare class ButtonGroup extends Vue { /** * 按钮组合大小,可选值为large、small、default或者不设置 * @default default diff --git a/types/iview/card.d.ts b/types/card.d.ts similarity index 92% rename from types/iview/card.d.ts rename to types/card.d.ts index b9864d51..7a3ce374 100644 --- a/types/iview/card.d.ts +++ b/types/card.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Card extends Vue { +export declare class Card extends Vue { /** * 是否显示边框,建议在灰色背景下使用 * @default true diff --git a/types/iview/carousel.d.ts b/types/carousel.d.ts similarity index 94% rename from types/iview/carousel.d.ts rename to types/carousel.d.ts index 3d636519..eaf3cb31 100644 --- a/types/iview/carousel.d.ts +++ b/types/carousel.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Carousel extends Vue { +export declare class Carousel extends Vue { /** * 幻灯片的索引,从 0 开始,可以使用 v-model 双向绑定数据 * @default 0 diff --git a/types/iview/cascader.d.ts b/types/cascader.d.ts similarity index 96% rename from types/iview/cascader.d.ts rename to types/cascader.d.ts index 67082d31..91720ca3 100644 --- a/types/iview/cascader.d.ts +++ b/types/cascader.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Cascader extends Vue { +export declare class Cascader extends Vue { /** * 可选项的数据源,格式参照示例说明 * @default [] diff --git a/types/iview/cell.d.ts b/types/cell.d.ts similarity index 91% rename from types/iview/cell.d.ts rename to types/cell.d.ts index 42a0acaf..866b5e19 100644 --- a/types/iview/cell.d.ts +++ b/types/cell.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Cell extends Vue { +export declare class Cell extends Vue { /** * 用来标识这一项 */ @@ -72,7 +72,7 @@ export interface Cell extends Vue { } } -export interface CellGroup extends Vue { +export declare class CellGroup extends Vue { /** * 点击单元格时触发 * diff --git a/types/iview/checkbox.d.ts b/types/checkbox.d.ts similarity index 93% rename from types/iview/checkbox.d.ts rename to types/checkbox.d.ts index 43d35bc5..adf0f457 100644 --- a/types/iview/checkbox.d.ts +++ b/types/checkbox.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Checkbox extends Vue { +export declare class Checkbox extends Vue { /** * 只在单独使用时有效。可以使用 v-model 双向绑定数据 * @default false @@ -44,7 +44,7 @@ export interface Checkbox extends Vue { $emit(eventName: 'on-change', value: boolean): this; } -export interface CheckboxGroup extends Vue { +export declare class CheckboxGroup extends Vue { /** * 指定选中项目的集合,可以使用 v-model 双向绑定数据 * @default [] diff --git a/types/iview/circle.d.ts b/types/circle.d.ts similarity index 93% rename from types/iview/circle.d.ts rename to types/circle.d.ts index f4adce51..57d8e0f0 100644 --- a/types/iview/circle.d.ts +++ b/types/circle.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Circle extends Vue { +export declare class Circle extends Vue { /** * 百分比 * @default 0 diff --git a/types/iview/collapse.d.ts b/types/collapse.d.ts similarity index 88% rename from types/iview/collapse.d.ts rename to types/collapse.d.ts index 0d6a2c4d..f0badd08 100644 --- a/types/iview/collapse.d.ts +++ b/types/collapse.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Collapse extends Vue { +export declare class Collapse extends Vue { /** * 当前激活的面板的 name,可以使用 v-model 双向绑定 */ @@ -26,7 +26,7 @@ export interface Collapse extends Vue { $emit(eventName: 'on-change', []): this; } -export interface CollapsePanel extends Vue { +export declare class CollapsePanel extends Vue { /** * 当前面板的 name,与 Collapse的value对应,不填为索引值 * @default index的值 diff --git a/types/iview/color-picker.d.ts b/types/color-picker.d.ts similarity index 93% rename from types/iview/color-picker.d.ts rename to types/color-picker.d.ts index 0b3258d3..8693e616 100644 --- a/types/iview/color-picker.d.ts +++ b/types/color-picker.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface ColorPicker extends Vue { +export declare class ColorPicker extends Vue { /** * 绑定的值,可使用 v-model 双向绑定 */ diff --git a/types/iview/date-picker.d.ts b/types/date-picker.d.ts similarity index 97% rename from types/iview/date-picker.d.ts rename to types/date-picker.d.ts index 0bf488b6..9d69dbcc 100644 --- a/types/iview/date-picker.d.ts +++ b/types/date-picker.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface DatePicker extends Vue { +export declare class DatePicker extends Vue { /** * 显示类型,可选值为 date、daterange、datetime、datetimerange、year、month'|'默认值date */ @@ -138,7 +138,7 @@ export interface DatePicker extends Vue { }; } -export interface DatePickerOptions extends Vue { +export declare class DatePickerOptions extends Vue { /** * 设置快捷选项,每项内容: * text:显示的文案 diff --git a/types/iview/divider.d.ts b/types/divider.d.ts similarity index 86% rename from types/iview/divider.d.ts rename to types/divider.d.ts index a2521ab5..1dc163c4 100644 --- a/types/iview/divider.d.ts +++ b/types/divider.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Divider extends Vue { +export declare class Divider extends Vue { /** * 水平还是垂直类型,可选值为 horizontal 或 vertical * @default horizontal diff --git a/types/iview/dropdown.d.ts b/types/dropdown.d.ts similarity index 93% rename from types/iview/dropdown.d.ts rename to types/dropdown.d.ts index f21b2ae6..14d9acc8 100644 --- a/types/iview/dropdown.d.ts +++ b/types/dropdown.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Dropdown extends Vue { +export declare class Dropdown extends Vue { /** * 触发方式,可选值为 hover(悬停)click(点击)contextMenu(右键)custom(自定义),使用 custom 时,需配合 visible 一起使用 * @default hover @@ -56,7 +56,7 @@ export interface Dropdown extends Vue { }; } -export interface DropdownItem extends Vue { +export declare class DropdownItem extends Vue { /** * 用来标识这一项 */ diff --git a/types/iview/form.d.ts b/types/form.d.ts similarity index 94% rename from types/iview/form.d.ts rename to types/form.d.ts index 72d8588f..1829a0e9 100644 --- a/types/iview/form.d.ts +++ b/types/form.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Form extends Vue { +export declare class Form extends Vue { /** * 表单数据对象 */ @@ -46,7 +46,7 @@ export interface Form extends Vue { resetFields(): void; } -export interface FormItem extends Vue { +export declare class FormItem extends Vue { /** * 对应表单域 model 里的字段 */ diff --git a/types/iview/grid.d.ts b/types/grid.d.ts similarity index 93% rename from types/iview/grid.d.ts rename to types/grid.d.ts index 41f7dfab..f038c622 100644 --- a/types/iview/grid.d.ts +++ b/types/grid.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface GridRow extends Vue { +export declare class GridRow extends Vue { /** * 栅格间距,单位 px,左右平分 * @default 0 @@ -28,7 +28,7 @@ export interface GridRow extends Vue { 'class-name'?: string; } -export interface GridCol extends Vue { +export declare class GridCol extends Vue { /** * 栅格的占位格数,可选值为0~24的整数,为 0 时,相当于display:none */ diff --git a/types/iview/icon.d.ts b/types/icon.d.ts similarity index 81% rename from types/iview/icon.d.ts rename to types/icon.d.ts index f6134417..767958a0 100644 --- a/types/iview/icon.d.ts +++ b/types/icon.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Icon extends Vue { +export declare class Icon extends Vue { /** * 图标的名称 */ diff --git a/types/index.d.ts b/types/index.d.ts new file mode 100644 index 00000000..46d6878b --- /dev/null +++ b/types/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for iview 3.0.1 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import iView from "./iview"; + +export default iView; +export as namespace iView; + +export * from "./iview.components"; \ No newline at end of file diff --git a/types/iview/input-number.d.ts b/types/input-number.d.ts similarity index 94% rename from types/iview/input-number.d.ts rename to types/input-number.d.ts index 222d6bde..af150ddd 100644 --- a/types/iview/input-number.d.ts +++ b/types/input-number.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface InputNumber extends Vue { +export declare class InputNumber extends Vue { /** * 最大值,默认值Infinity */ diff --git a/types/iview/input.d.ts b/types/input.d.ts similarity index 97% rename from types/iview/input.d.ts rename to types/input.d.ts index 760968c6..201c6a96 100644 --- a/types/iview/input.d.ts +++ b/types/input.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Input extends Vue { +export declare class Input extends Vue { /** * 输入框类型,可选值为 text、password、textarea、url、email、date * @default text diff --git a/types/iview.components.d.ts b/types/iview.components.d.ts new file mode 100644 index 00000000..a5a7ba33 --- /dev/null +++ b/types/iview.components.d.ts @@ -0,0 +1,143 @@ +import { Affix } from "./affix"; +import { Alert } from "./alert"; +import { Anchor, AnchorLink } from "./anchor"; +import { AutoComplete } from "./auto-complete"; +import { Avatar } from "./avatar"; +import { BackTop } from "./back-top"; +import { Badge } from "./badge"; +import { Breadcrumb, BreadcrumbItem } from "./breadcrumb"; +import { Button, ButtonGroup } from "./button"; +import { Card } from "./card"; +import { Carousel } from "./carousel"; +import { Cascader } from "./cascader"; +import { Cell, CellGroup } from "./cell"; +import { Checkbox, CheckboxGroup } from "./checkbox"; +import { Circle } from "./circle"; +import { Collapse, CollapsePanel } from "./collapse"; +import { ColorPicker } from "./color-picker"; +import { DatePicker, DatePickerOptions } from "./date-picker"; +import { Divider } from "./divider"; +import { Dropdown, DropdownItem } from "./dropdown"; +import { Form, FormItem } from "./form"; +import { GridRow, GridCol } from "./grid"; +import { Icon } from "./icon"; +import { Input } from "./input"; +import { InputNumber } from "./input-number"; +import { Layout } from "./layout"; +import { LoadingBarInstance, LoadingBarConfig } from "./loading-bar"; +import { Menu, MenuItem, Submenu, MenuGroup } from "./menu"; +import { MessageInstance, MessageConfig } from "./message"; +import { Modal, ModalInstance, ModalConfig } from "./modal"; +import { NoticeInstance, NoticeConfig, NoticeGlobalConfig } from "./notice"; +import { Page } from "./page"; +import { Poptip } from "./poptip"; +import { Progress } from "./progress"; +import { Radio, RadioGroup } from "./radio"; +import { Rate } from "./rate"; +import { Scroll } from "./scroll"; +import { Select, SelectOption, SelectOptionGroup } from "./select"; +import { Spin } from "./spin"; +import { Split } from "./split"; +import { Steps, Step } from "./steps"; +import { Switch } from "./switch"; +import { + Table, + TableColumn, + TableRenderCreateElementData, + TableRenderCreateElementResult, + TableColumnRenderParams, + TableExportCsvParams +} from "./table"; +import { Tabs, TabPane } from "./tabs"; +import { Tag } from "./tag"; +import { Time } from "./time"; +import { Timeline, TimelineItem } from "./timeline"; +import { TimePicker } from "./time-picker"; +import { Tooltip } from "./tooltip"; +import { Transfer } from "./transfer"; +import { Tree, TreeChild } from "./tree"; +import { Upload } from "./upload"; + +export class IAffix extends Affix {} +export class IAlert extends Alert {} +export class IAnchor extends Anchor {} +export class IAnchorLink extends AnchorLink {} +export class IAutoComplete extends AutoComplete {} +export class IAvatar extends Avatar {} +export class IBackTop extends BackTop {} +export class IBadge extends Badge {} +export class IBreadcrumb extends Breadcrumb {} +export class IBreadcrumbItem extends BreadcrumbItem {} +export class IButton extends Button {} +export class IButtonGroup extends ButtonGroup {} +export class ICard extends Card {} +export class ICarousel extends Carousel {} +export class ICascader extends Cascader {} +export class ICell extends Cell {} +export class ICellGroup extends CellGroup {} +export class ICheckbox extends Checkbox {} +export class ICheckboxGroup extends CheckboxGroup {} +export class ICircle extends Circle {} +export class ICollapse extends Collapse {} +export class ICollapsePanel extends CollapsePanel {} +export class IColorPicker extends ColorPicker {} +export class IDatePicker extends DatePicker {} +export class IDatePickerOptions extends DatePickerOptions {} +export class IDivider extends Divider {} +export class IDropdown extends Dropdown {} +export class IDropdownItem extends DropdownItem {} +export class IForm extends Form {} +export class IFormItem extends FormItem {} +export class IGridCol extends GridCol {} +export class IGridRow extends GridRow {} +export class IIcon extends Icon {} +export class IInput extends Input {} +export class IInputNumber extends InputNumber {} +export class ILayout extends Layout {} +export class ILoadingBarInstance extends LoadingBarInstance {} +export class ILoadingBarConfig extends LoadingBarConfig {} +export class IMenu extends Menu {} +export class IMenuGroup extends MenuGroup {} +export class IMenuItem extends MenuItem {} +export class IMessageConfig extends MessageConfig {} +export class IMessageInstance extends MessageInstance {} +export class IModal extends Modal {} +export class IModalConfig extends ModalConfig {} +export class IModalInstance extends ModalInstance {} +export class INoticeConfig extends NoticeConfig {} +export class INoticeGlobalConfig extends NoticeGlobalConfig {} +export class INoticeInstance extends NoticeInstance {} +export class IPage extends Page {} +export class IPoptip extends Poptip {} +export class IProgress extends Progress {} +export class IRadio extends Radio {} +export class IRadioGroup extends RadioGroup {} +export class IRate extends Rate {} +export class IScroll extends Scroll {} +export class ISelect extends Select {} +export class ISelectOption extends SelectOption {} +export class ISelectOptionGroup extends SelectOptionGroup {} +export class ISpin extends Spin {} +export class ISplit extends Split {} +export class IStep extends Step {} +export class ISteps extends Steps {} +export class ISubmenu extends Submenu {} +export class ISwitch extends Switch {} +export class ITable extends Table {} +export class ITableColumn extends TableColumn {} +export class ITableColumnRenderParams extends TableColumnRenderParams {} +export class ITableExportCsvParams extends TableExportCsvParams {} +export class ITableRenderCreateElementData extends TableRenderCreateElementData {} +export class ITableRenderCreateElementResult extends TableRenderCreateElementResult {} +export class ITabPane extends TabPane {} +export class ITabs extends Tabs {} +export class ITag extends Tag {} +export class ITime extends Time {} +export class ITimeline extends Timeline {} +export class ITimelineItem extends TimelineItem {} +export class ITimePicker extends TimePicker {} +export class ITooltip extends Tooltip {} +export class ITransfer extends Transfer {} +export class ITree extends Tree {} +export class ITreeChild extends TreeChild {} +export class IUpload extends Upload {} diff --git a/types/iview.d.ts b/types/iview.d.ts new file mode 100644 index 00000000..1f12f3aa --- /dev/null +++ b/types/iview.d.ts @@ -0,0 +1,6 @@ +import { PluginFunction } from 'vue'; + +interface IView extends PluginFunction {} + +declare const iView: IView; +export default iView; diff --git a/types/iview/index.d.ts b/types/iview/index.d.ts deleted file mode 100644 index 62152192..00000000 --- a/types/iview/index.d.ts +++ /dev/null @@ -1,237 +0,0 @@ -// Type definitions for iview 3.0.0 -// Project: https://github.com/iview/iview -// Definitions by: yangdan -// Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode, PluginFunction } from "vue"; - -import { Affix } from "./affix"; -import { Alert } from "./alert"; -import { Anchor, AnchorLink } from "./anchor"; -import { AutoComplete } from "./auto-complete"; -import { Avatar } from "./avatar"; -import { BackTop } from "./back-top"; -import { Badge } from "./badge"; -import { Breadcrumb, BreadcrumbItem } from "./breadcrumb"; -import { Button, ButtonGroup } from "./button"; -import { Card } from "./card"; -import { Carousel } from "./carousel"; -import { Cascader } from "./cascader"; -import { Cell, CellGroup } from "./cell"; -import { Checkbox, CheckboxGroup } from "./checkbox"; -import { Circle } from "./circle"; -import { Collapse, CollapsePanel } from "./collapse"; -import { ColorPicker } from "./color-picker"; -import { DatePicker, DatePickerOptions } from "./date-picker"; -import { Divider } from "./divider"; -import { Dropdown, DropdownItem } from "./dropdown"; -import { Form, FormItem } from "./form"; -import { GridRow, GridCol } from "./grid"; -import { Icon } from "./icon"; -import { Input } from "./input"; -import { InputNumber } from "./input-number"; -import { Layout } from "./layout"; -import { LoadingBarInstance, LoadingBarConfig } from "./loading-bar"; -import { Menu, MenuItem, Submenu, MenuGroup } from "./menu"; -import { MessageInstance, MessageConfig } from "./message"; -import { Modal, ModalInstance, ModalConfig } from "./modal"; -import { NoticeInstance, NoticeConfig, NoticeGlobalConfig } from "./notice"; -import { Page } from "./page"; -import { Poptip } from "./poptip"; -import { Progress } from "./progress"; -import { Radio, RadioGroup } from "./radio"; -import { Rate } from "./rate"; -import { Scroll } from "./scroll"; -import { Select, SelectOption, SelectOptionGroup } from "./select"; -import { Spin } from "./spin"; -import { Split } from "./split"; -import { Steps, Step } from "./steps"; -import { Switch } from "./switch"; -import { Table, TableColumn, TableRenderCreateElementData, TableRenderCreateElementResult, TableColumnRenderParams, TableExportCsvParams } from "./table"; -import { Tabs, TabPane } from "./tabs"; -import { Tag } from "./tag"; -import { Time } from "./time"; -import { Timeline, TimelineItem } from "./timeline"; -import { TimePicker } from "./time-picker"; -import { Tooltip } from "./tooltip"; -import { Transfer } from "./transfer"; -import { Tree, TreeChild } from "./tree"; -import { Upload } from "./upload"; - -declare namespace IView { - type IAffix = Affix; - type IAlert = Alert; - type IAnchor = Anchor; - type IAnchorLink = AnchorLink; - type IAutoComplete = AutoComplete; - type IAvatar = Avatar; - type IBackTop = BackTop; - type IBadge = Badge; - type IBreadcrumb = Breadcrumb; - type IBreadcrumbItem = BreadcrumbItem; - type IButton = Button; - type IButtonGroup = ButtonGroup; - type ICard = Card; - type ICarousel = Carousel; - type ICascader = Cascader; - type ICell = Cell; - type ICellGroup = CellGroup; - type ICheckbox = Checkbox; - type ICheckboxGroup = CheckboxGroup; - type ICircle = Circle; - type ICollapse = Collapse; - type ICollapsePanel = CollapsePanel; - type IColorPicker = ColorPicker; - type IDatePicker = DatePicker; - type IDatePickerOptions = DatePickerOptions; - type IDivider = Divider; - type IDropdown = Dropdown; - type IDropdownItem = DropdownItem; - type IForm = Form; - type IFormItem = FormItem; - type IGridCol = GridCol; - type IGridRow = GridRow; - type IIcon = Icon; - type IInput = Input; - type IInputNumber = InputNumber; - type ILayout = Layout; - type ILoadingBarInstance = LoadingBarInstance; - type ILoadingBarConfig = LoadingBarConfig; - type IMenu = Menu; - type IMenuGroup = MenuGroup; - type IMenuItem = MenuItem; - type IMessageConfig = MessageConfig; - type IMessageInstance = MessageInstance; - type IModal = Modal; - type IModalConfig = ModalConfig; - type IModalInstance = ModalInstance; - type INoticeConfig = NoticeConfig; - type INoticeGlobalConfig = NoticeGlobalConfig; - type INoticeInstance = NoticeInstance; - type IPage = Page; - type IPoptip = Poptip; - type IProgress = Progress; - type IRadio = Radio; - type IRadioGroup = RadioGroup; - type IRate = Rate; - type IScroll = Scroll; - type ISelect = Select; - type ISelectOption = SelectOption; - type ISelectOptionGroup = SelectOptionGroup; - type ISpin = Spin; - type ISplit = Split; - type IStep = Step; - type ISteps = Steps; - type ISubmenu = Submenu; - type ISwitch = Switch; - type ITable = Table; - type ITableColumn = TableColumn; - type ITableColumnRenderParams = TableColumnRenderParams; - type ITableExportCsvParams = TableExportCsvParams; - type ITableRenderCreateElementData = TableRenderCreateElementData; - type ITableRenderCreateElementResult = TableRenderCreateElementResult; - type ITabPane = TabPane; - type ITabs = Tabs; - type ITag = Tag; - type ITime = Time; - type ITimeline = Timeline; - type ITimelineItem = TimelineItem; - type ITimePicker = TimePicker; - type ITooltip = Tooltip; - type ITransfer = Transfer; - type ITree = Tree; - type ITreeChild = TreeChild; - type IUpload = Upload; -} - -declare interface IView extends PluginFunction { - readonly IAffix: Affix; - readonly IAlert: Alert; - readonly IAnchor: Anchor; - readonly IAnchorLink: AnchorLink; - readonly IAutoComplete: AutoComplete; - readonly IAvatar: Avatar; - readonly IBackTop: BackTop; - readonly IBadge: Badge; - readonly IBreadcrumb: Breadcrumb; - readonly IBreadcrumbItem: BreadcrumbItem; - readonly IButton: Button; - readonly IButtonGroup: ButtonGroup; - readonly ICard: Card; - readonly ICarousel: Carousel; - readonly ICascader: Cascader; - readonly ICell: Cell; - readonly ICellGroup: CellGroup; - readonly ICheckbox: Checkbox; - readonly ICheckboxGroup: CheckboxGroup; - readonly ICircle: Circle; - readonly ICollapse: Collapse; - readonly ICollapsePanel: CollapsePanel; - readonly IColorPicker: ColorPicker; - readonly IDatePicker: DatePicker; - readonly IDatePickerOptions: DatePickerOptions; - readonly IDivider: Divider; - readonly IDropdown: Dropdown; - readonly IDropdownItem: DropdownItem; - readonly IForm: Form; - readonly IFormItem: FormItem; - readonly IGridCol: GridCol; - readonly IGridRow: GridRow; - readonly IIcon: Icon; - readonly IInput: Input; - readonly IInputNumber: InputNumber; - readonly ILayout: Layout; - readonly ILoadingBarInstance: LoadingBarInstance; - readonly ILoadingBarConfig: LoadingBarConfig; - readonly IMenu: Menu; - readonly IMenuGroup: MenuGroup; - readonly IMenuItem: MenuItem; - readonly IMessageConfig: MessageConfig; - readonly IMessageInstance: MessageInstance; - readonly IModal: Modal; - readonly IModalConfig: ModalConfig; - readonly IModalInstance: ModalInstance; - readonly INoticeConfig: NoticeConfig; - readonly INoticeGlobalConfig: NoticeGlobalConfig; - readonly INoticeInstance: NoticeInstance; - readonly IPage: Page; - readonly IPoptip: Poptip; - readonly IProgress: Progress; - readonly IRadio: Radio; - readonly IRadioGroup: RadioGroup; - readonly IRate: Rate; - readonly IScroll: Scroll; - readonly ISelect: Select; - readonly ISelectOption: SelectOption; - readonly ISelectOptionGroup: SelectOptionGroup; - readonly ISpin: Spin; - readonly ISplit: Split; - readonly IStep: Step; - readonly ISteps: Steps; - readonly ISubmenu: Submenu; - readonly ISwitch: Switch; - readonly ITable: Table; - readonly ITableColumn: TableColumn; - readonly ITableColumnRenderParams: TableColumnRenderParams; - readonly ITableExportCsvParams: TableExportCsvParams; - readonly ITableRenderCreateElementData: TableRenderCreateElementData; - readonly ITableRenderCreateElementResult: TableRenderCreateElementResult; - readonly ITabPane: TabPane; - readonly ITabs: Tabs; - readonly ITag: Tag; - readonly ITime: Time; - readonly ITimeline: Timeline; - readonly ITimelineItem: TimelineItem; - readonly ITimePicker: TimePicker; - readonly ITooltip: Tooltip; - readonly ITransfer: Transfer; - readonly ITree: Tree; - readonly ITreeChild: TreeChild; - readonly IUpload: Upload; -} - -export default IView; - -declare module 'iview/types/iview' { - const iView: IView; - export default iView; -} diff --git a/types/iview/iview.d.ts b/types/iview/iview.d.ts deleted file mode 100644 index 408519fa..00000000 --- a/types/iview/iview.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare module 'iview' { - const iView: any; - export default iView; -} \ No newline at end of file diff --git a/types/iview/layout.d.ts b/types/layout.d.ts similarity index 95% rename from types/iview/layout.d.ts rename to types/layout.d.ts index cadc4c45..56e353b6 100644 --- a/types/iview/layout.d.ts +++ b/types/layout.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Layout extends Vue { +export declare class Layout extends Vue { /** * 触发响应式布局的断点,可选值为xs,sm,md,lg,xl或xxl,若不设此属性则不会触发响应式布局。 * { diff --git a/types/iview/loading-bar.d.ts b/types/loading-bar.d.ts similarity index 90% rename from types/iview/loading-bar.d.ts rename to types/loading-bar.d.ts index 2111efa6..0c7483da 100644 --- a/types/iview/loading-bar.d.ts +++ b/types/loading-bar.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface LoadingBarInstance { +export declare class LoadingBarInstance { /** * 开始从 0 显示进度条,并自动加载进度 */ @@ -33,7 +33,7 @@ export interface LoadingBarInstance { destroy(): void; } -export interface LoadingBarConfig { +export declare class LoadingBarConfig { /** * 进度条的颜色,默认为 iView 主色 * @default primary diff --git a/types/iview/menu.d.ts b/types/menu.d.ts similarity index 91% rename from types/iview/menu.d.ts rename to types/menu.d.ts index 1a8cc7ec..8a1ca054 100644 --- a/types/iview/menu.d.ts +++ b/types/menu.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Menu extends Vue { +export declare class Menu extends Vue { /** * 菜单类型,可选值为 horizontal(水平) 和 vertical(垂直) * @default vertical @@ -52,7 +52,7 @@ export interface Menu extends Vue { updateActiveName(): void; } -export interface MenuItem extends Vue { +export declare class MenuItem extends Vue { /** * 菜单项的唯一标识,必填 */ @@ -73,7 +73,7 @@ export interface MenuItem extends Vue { target?: '_blank' | '_self' | '_parent' | '_top'; } -export interface Submenu extends Vue { +export declare class Submenu extends Vue { /** * 子菜单的唯一标识,必填 */ @@ -93,7 +93,7 @@ export interface Submenu extends Vue { }; } -export interface MenuGroup extends Vue { +export declare class MenuGroup extends Vue { /** * 分组标题 * @default 空 diff --git a/types/iview/message.d.ts b/types/message.d.ts similarity index 93% rename from types/iview/message.d.ts rename to types/message.d.ts index a49659ab..76e4d100 100644 --- a/types/iview/message.d.ts +++ b/types/message.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode, CreateElement } from "vue"; -export interface MessageInstance { +export declare class MessageInstance { /** * 消息 * @param config MessageConfig为相关配置,string为待显示的内容 @@ -41,7 +41,7 @@ export interface MessageInstance { destroy(): void; } -export interface MessageConfig { +export declare class MessageConfig { /** * 提示内容 */ diff --git a/types/iview/modal.d.ts b/types/modal.d.ts similarity index 97% rename from types/iview/modal.d.ts rename to types/modal.d.ts index ed8a50fe..89972948 100644 --- a/types/iview/modal.d.ts +++ b/types/modal.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Modal { +export declare class Modal { /** * 对话框是否显示,可使用 v-model 双向绑定数据。 * @default false @@ -123,7 +123,7 @@ export interface Modal { }; } -export interface ModalInstance { +export declare class ModalInstance { /** * 消息 * @param config ModalConfig为相关配置,string为待显示的内容 @@ -155,7 +155,7 @@ export interface ModalInstance { remove(): void; } -export interface ModalConfig { +export declare class ModalConfig { /** * 标题或者Element选择器字符串 */ diff --git a/types/iview/notice.d.ts b/types/notice.d.ts similarity index 92% rename from types/iview/notice.d.ts rename to types/notice.d.ts index 808b1f6e..e6cf8518 100644 --- a/types/iview/notice.d.ts +++ b/types/notice.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode, CreateElement } from "vue"; -export interface NoticeInstance { +export declare class NoticeInstance { /** * 打开 * @param config NoticeConfig为相关配置,string为待显示的内容 @@ -44,7 +44,7 @@ export interface NoticeInstance { destroy(): void; } -export interface NoticeConfig { +export declare class NoticeConfig { /** * 通知提醒的标题 */ @@ -71,7 +71,7 @@ export interface NoticeConfig { onClose?: Function; } -export interface NoticeGlobalConfig { +export declare class NoticeGlobalConfig { /** * 通知组件距离顶端的距离,单位像素 默认24 */ diff --git a/types/iview/page.d.ts b/types/page.d.ts similarity index 96% rename from types/iview/page.d.ts rename to types/page.d.ts index 2e8cd7c0..87268180 100644 --- a/types/iview/page.d.ts +++ b/types/page.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Page extends Vue { +export declare class Page extends Vue { /** * 当前页码,支持 .sync 修饰符 * @default 1 diff --git a/types/iview/poptip.d.ts b/types/poptip.d.ts similarity index 97% rename from types/iview/poptip.d.ts rename to types/poptip.d.ts index 58d321b9..54be59d0 100644 --- a/types/iview/poptip.d.ts +++ b/types/poptip.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Poptip extends Vue { +export declare class Poptip extends Vue { /** * 触发方式,可选值为hover(悬停)click(点击)focus(聚焦), * 在 confirm 模式下,只有 click 有效 diff --git a/types/iview/progress.d.ts b/types/progress.d.ts similarity index 91% rename from types/iview/progress.d.ts rename to types/progress.d.ts index 5d4748f3..c380a5bf 100644 --- a/types/iview/progress.d.ts +++ b/types/progress.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Progress extends Vue { +export declare class Progress extends Vue { /** * 百分比 * @default 0 diff --git a/types/iview/radio.d.ts b/types/radio.d.ts similarity index 93% rename from types/iview/radio.d.ts rename to types/radio.d.ts index 32c1104c..108443a4 100644 --- a/types/iview/radio.d.ts +++ b/types/radio.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Radio extends Vue { +export declare class Radio extends Vue { /** * 只在单独使用时有效。可以使用 v-model 双向绑定数据 * @default false @@ -39,7 +39,7 @@ export interface Radio extends Vue { $emit(eventName: 'on-change', arg: string | number | boolean): this; } -export interface RadioGroup extends Vue { +export declare class RadioGroup extends Vue { /** * 指定当前选中的项目数据。可以使用 v-model 双向绑定数据 */ diff --git a/types/iview/rate.d.ts b/types/rate.d.ts similarity index 92% rename from types/iview/rate.d.ts rename to types/rate.d.ts index 09b36887..7b5f455c 100644 --- a/types/iview/rate.d.ts +++ b/types/rate.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Rate extends Vue { +export declare class Rate extends Vue { /** * star总数 * @default 5 diff --git a/types/iview/scroll.d.ts b/types/scroll.d.ts similarity index 91% rename from types/iview/scroll.d.ts rename to types/scroll.d.ts index dae6ccf4..54f7d574 100644 --- a/types/iview/scroll.d.ts +++ b/types/scroll.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Scroll extends Vue { +export declare class Scroll extends Vue { /** * 滚动区域的高度,单位像素 * @default 300 diff --git a/types/iview/select.d.ts b/types/select.d.ts similarity index 95% rename from types/iview/select.d.ts rename to types/select.d.ts index fc555bda..63ccab20 100644 --- a/types/iview/select.d.ts +++ b/types/select.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Select extends Vue { +export declare class Select extends Vue { /** * 指定选中项目的 value 值,可以使用 v-model 双向绑定数据。 * 单选时只接受 String 或 Number,多选时只接受 Array @@ -114,7 +114,7 @@ export interface Select extends Vue { clearSingleSelect(): void; } -export interface SelectOption extends Vue { +export declare class SelectOption extends Vue { /** * 选项值,默认根据此属性值进行筛选,必填 */ @@ -132,7 +132,7 @@ export interface SelectOption extends Vue { disabled?: boolean; } -export interface SelectOptionGroup extends Vue { +export declare class SelectOptionGroup extends Vue { /** * 分组的组名 * @default 空 diff --git a/types/iview/slider.d.ts b/types/slider.d.ts similarity index 96% rename from types/iview/slider.d.ts rename to types/slider.d.ts index 767069a5..8d2cbd38 100644 --- a/types/iview/slider.d.ts +++ b/types/slider.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Slider extends Vue { +export declare class Slider extends Vue { /** * 滑块选定的值,可以使用 v-model 双向绑定数据。普通模式下,数据格式为数字, * 在双滑块模式下,数据格式为长度是2的数组,且每项都为数字, diff --git a/types/iview/spin.d.ts b/types/spin.d.ts similarity index 87% rename from types/iview/spin.d.ts rename to types/spin.d.ts index 50a8ce41..7e7d48ac 100644 --- a/types/iview/spin.d.ts +++ b/types/spin.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Spin extends Vue { +export declare class Spin extends Vue { /** * Spin尺寸,可选值为large和small或者不设置 */ diff --git a/types/iview/split.d.ts b/types/split.d.ts similarity index 94% rename from types/iview/split.d.ts rename to types/split.d.ts index 067456ce..f939b573 100644 --- a/types/iview/split.d.ts +++ b/types/split.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Split extends Vue { +export declare class Split extends Vue { /** * 面板位置,可以是 0~1 代表百分比,或具体数值的像素,可用 v-model 双向绑定 * @default 0.5 diff --git a/types/iview/steps.d.ts b/types/steps.d.ts similarity index 89% rename from types/iview/steps.d.ts rename to types/steps.d.ts index 8e8ad5b7..75749977 100644 --- a/types/iview/steps.d.ts +++ b/types/steps.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Steps extends Vue { +export declare class Steps extends Vue { /** * 当前步骤,从 0 开始计数 * @default 0 @@ -26,7 +26,7 @@ export interface Steps extends Vue { direction?: 'horizontal' | 'vertical'; } -export interface Step extends Vue { +export declare class Step extends Vue { /** * 步骤的状态,可选值为wait、process、finish、error,不设置时自动判断 * @default process diff --git a/types/iview/switch.d.ts b/types/switch.d.ts similarity index 94% rename from types/iview/switch.d.ts rename to types/switch.d.ts index b64744f8..c1435849 100644 --- a/types/iview/switch.d.ts +++ b/types/switch.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Switch extends Vue { +export declare class Switch extends Vue { /** * 指定当前是否选中,可以使用 v-model 双向绑定数据 * @default false diff --git a/types/iview/table.d.ts b/types/table.d.ts similarity index 96% rename from types/iview/table.d.ts rename to types/table.d.ts index eb11b9c2..35908740 100644 --- a/types/iview/table.d.ts +++ b/types/table.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Table extends Vue { +export declare class Table extends Vue { /** * 显示的结构化数据,其中,字段 cellClassName 用于设置任意单元格的样式名称, * 因此数据不能使用该字段,详见示例特定样式。 @@ -163,7 +163,7 @@ export interface Table extends Vue { }; } -export interface TableColumn { +export declare class TableColumn { /** * 列类型,可选值为 index、selection、expand、html */ @@ -279,7 +279,7 @@ export interface TableColumn { children?: object[]; } -export interface TableRenderCreateElementData { +export declare class TableRenderCreateElementData { /** * 和`v-bind:class`一样的 API */ @@ -329,7 +329,7 @@ export interface TableRenderCreateElementData { ref?: string } -export interface TableColumnRenderParams { +export declare class TableColumnRenderParams { /** * 当前行数据 */ @@ -344,7 +344,7 @@ export interface TableColumnRenderParams { index?: number; } -export interface TableRenderCreateElementResult { +export declare class TableRenderCreateElementResult { child?: object; children?: Array; componentInstance?: object; @@ -366,7 +366,7 @@ export interface TableRenderCreateElementResult { text?: object; } -export interface TableColumnRenderHeadParams { +export declare class TableColumnRenderHeadParams { /** * 当前列数据 */ @@ -377,7 +377,7 @@ export interface TableColumnRenderHeadParams { index?: number; } -export interface TableExportCsvParams { +export declare class TableExportCsvParams { /** * 文件名,默认为 table.csv */ diff --git a/types/iview/tabs.d.ts b/types/tabs.d.ts similarity index 93% rename from types/iview/tabs.d.ts rename to types/tabs.d.ts index 2bd112fc..1be00a8c 100644 --- a/types/iview/tabs.d.ts +++ b/types/tabs.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Tabs extends Vue { +export declare class Tabs extends Vue { /** * 当前激活 tab 面板的 name,可以使用 v-model 双向绑定数据 * @default 默认为第一项的 name @@ -54,7 +54,7 @@ export interface Tabs extends Vue { }; } -export interface TabPane extends Vue { +export declare class TabPane extends Vue { /** * 用于标识当前面板,对应 value,默认为其索引值 */ diff --git a/types/iview/tag.d.ts b/types/tag.d.ts similarity index 94% rename from types/iview/tag.d.ts rename to types/tag.d.ts index dbf9160c..cc3fd9ca 100644 --- a/types/iview/tag.d.ts +++ b/types/tag.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Tag extends Vue { +export declare class Tag extends Vue { /** * 标签是否可以关闭 * @default false diff --git a/types/iview/time-picker.d.ts b/types/time-picker.d.ts similarity index 98% rename from types/iview/time-picker.d.ts rename to types/time-picker.d.ts index 943053c3..22b973bc 100644 --- a/types/iview/time-picker.d.ts +++ b/types/time-picker.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface TimePicker extends Vue { +export declare class TimePicker extends Vue { /** * 显示类型,可选值为 time、timerange * @default time diff --git a/types/iview/time.ts b/types/time.ts similarity index 88% rename from types/iview/time.ts rename to types/time.ts index 7de152ed..d5b2a1f2 100644 --- a/types/iview/time.ts +++ b/types/time.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Time extends Vue { +export declare class Time extends Vue { /** * 需要对比的时间,可以是时间戳或 Date 类型 */ diff --git a/types/iview/timeline.d.ts b/types/timeline.d.ts similarity index 81% rename from types/iview/timeline.d.ts rename to types/timeline.d.ts index fa6ce3f6..5f036faf 100644 --- a/types/iview/timeline.d.ts +++ b/types/timeline.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Timeline extends Vue { +export declare class Timeline extends Vue { /** * 指定是否最后一个节点为幽灵节点 * @default false @@ -12,7 +12,7 @@ export interface Timeline extends Vue { pending?: boolean; } -export interface TimelineItem extends Vue { +export declare class TimelineItem extends Vue { /** * 圆圈颜色,可选值为blue、red、green,或自定义色值 * @default blue diff --git a/types/iview/tooltip.d.ts b/types/tooltip.d.ts similarity index 96% rename from types/iview/tooltip.d.ts rename to types/tooltip.d.ts index 3dff6994..477f9f8a 100644 --- a/types/iview/tooltip.d.ts +++ b/types/tooltip.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Tooltip extends Vue { +export declare class Tooltip extends Vue { /** * 显示的内容 * @default 空 diff --git a/types/iview/transfer.d.ts b/types/transfer.d.ts similarity index 95% rename from types/iview/transfer.d.ts rename to types/transfer.d.ts index 9ec98b96..95c9d006 100644 --- a/types/iview/transfer.d.ts +++ b/types/transfer.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Transfer extends Vue { +export declare class Transfer extends Vue { /** * 数据源,其中的数据将会被渲染到左边一栏中,targetKeys 中指定的除外。 * @default [] diff --git a/types/iview/tree.d.ts b/types/tree.d.ts similarity index 94% rename from types/iview/tree.d.ts rename to types/tree.d.ts index c8640a1d..65b219cc 100644 --- a/types/iview/tree.d.ts +++ b/types/tree.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Tree extends Vue { +export declare class Tree extends Vue { /** * 可嵌套的节点属性的数组,生成 tree 的数据 */ @@ -62,7 +62,7 @@ export interface Tree extends Vue { getSelectedNodes(): void; } -export interface TreeChild extends Vue { +export declare class TreeChild extends Vue { /** * 标题 */ diff --git a/types/iview/upload.d.ts b/types/upload.d.ts similarity index 97% rename from types/iview/upload.d.ts rename to types/upload.d.ts index 94305167..7696eeff 100644 --- a/types/iview/upload.d.ts +++ b/types/upload.d.ts @@ -1,10 +1,10 @@ -// Type definitions for iview 3.0.0 +// Type definitions for iview 3.0.1 // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode } from "vue"; -export interface Upload extends Vue { +export declare class Upload extends Vue { /** * 上传的地址,必填 */ diff --git a/yarn.lock b/yarn.lock index b0df71bc..4f20cc80 100644 --- a/yarn.lock +++ b/yarn.lock @@ -314,7 +314,7 @@ arraybuffer.slice@~0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz#3bbc4275dd584cc1b10809b89d4e8b63a69e7675" -arrify@^1.0.0: +arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -1843,6 +1843,19 @@ copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" +copy-webpack-plugin@^4.5.2: + version "4.5.2" + resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-4.5.2.tgz#d53444a8fea2912d806e78937390ddd7e632ee5c" + dependencies: + cacache "^10.0.4" + find-cache-dir "^1.0.0" + globby "^7.1.1" + is-glob "^4.0.0" + loader-utils "^1.1.0" + minimatch "^3.0.4" + p-limit "^1.0.0" + serialize-javascript "^1.4.0" + core-js@^1.0.0: version "1.2.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" @@ -2251,6 +2264,13 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" +dir-glob@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.0.0.tgz#0b205d2b6aef98238ca286598a8204d29d0a0034" + dependencies: + arrify "^1.0.1" + path-type "^3.0.0" + dns-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d" @@ -3439,6 +3459,17 @@ globby@^6.1.0: pify "^2.0.0" pinkie-promise "^2.0.0" +globby@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/globby/-/globby-7.1.1.tgz#fb2ccff9401f8600945dfada97440cca972b8680" + dependencies: + array-union "^1.0.1" + dir-glob "^2.0.0" + glob "^7.1.2" + ignore "^3.3.5" + pify "^3.0.0" + slash "^1.0.0" + globule@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/globule/-/globule-0.1.0.tgz#d9c8edde1da79d125a151b79533b978676346ae5" @@ -3961,6 +3992,10 @@ ignore@^3.2.0: version "3.3.8" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.8.tgz#3f8e9c35d38708a3a7e0e9abb6c73e7ee7707b2b" +ignore@^3.3.5: + version "3.3.10" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" + image-size@~0.5.0: version "0.5.5" resolved "https://registry.yarnpkg.com/image-size/-/image-size-0.5.5.tgz#09dfd4ab9d20e29eb1c3e80b8990378df9e3cb9c" @@ -5725,6 +5760,12 @@ p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" +p-limit@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + dependencies: + p-try "^1.0.0" + p-limit@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.2.0.tgz#0e92b6bedcb59f022c13d0f1949dc82d15909f1c" @@ -5930,6 +5971,12 @@ path-type@^2.0.0: dependencies: pify "^2.0.0" +path-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + dependencies: + pify "^3.0.0" + pathval@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" From 61d5f551fd1f28e9e5899354919cb0ae1d0f5cae Mon Sep 17 00:00:00 2001 From: yangd Date: Thu, 30 Aug 2018 14:47:55 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=89=93=E5=8C=85=E5=88=B0=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E6=96=87=E4=BB=B6=E5=A4=B9,=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=88=B03.0.1=E7=9A=84api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/webpack.dist.prod.config.js | 11 +++++++---- types/select.d.ts | 6 +++--- yarn.lock | 26 +++++++++++++++++++------- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/build/webpack.dist.prod.config.js b/build/webpack.dist.prod.config.js index 656f49f1..94cc5829 100644 --- a/build/webpack.dist.prod.config.js +++ b/build/webpack.dist.prod.config.js @@ -36,7 +36,7 @@ module.exports = merge(webpackBaseConfig, { }), new UglifyJsPlugin({ parallel: true, - sourceMap: true, + sourceMap: true }), new CompressionPlugin({ asset: '[path].gz[query]', @@ -45,8 +45,11 @@ module.exports = merge(webpackBaseConfig, { threshold: 10240, minRatio: 0.8 }), - new CopyWebpackPlugin([{ - from: __dirname + '/../types' - }]) + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, './../types'), + to: path.resolve(__dirname, './../dist/types') + } + ]) ] }); diff --git a/types/select.d.ts b/types/select.d.ts index 63ccab20..789a05ac 100644 --- a/types/select.d.ts +++ b/types/select.d.ts @@ -74,10 +74,10 @@ export declare class Select extends Vue { */ 'label-in-value'?: boolean; /** - * 弹窗的展开方向,可选值为 bottom 和 top - * @default bottom + * 弹窗的展开方向,可选值为 top、bottom、top-start、bottom-start、top-end、bottom-end + * @default bottom-start */ - placement?: 'bottom' | 'top'; + placement?: 'bottom' | 'top' | 'top-start' | 'bottom-start' | 'top-end' | 'bottom-end'; /** * 是否将弹层放置于 body 内,在 Tabs、带有 fixed 的 Table 列内使用时, * 建议添加此属性,它将不受父级样式影响,从而达到更好的效果 diff --git a/yarn.lock b/yarn.lock index 4f20cc80..d439e34d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1572,6 +1572,12 @@ clean-css@4.1.11, clean-css@4.1.x: dependencies: source-map "0.5.x" +clean-webpack-plugin@^0.1.19: + version "0.1.19" + resolved "https://registry.yarnpkg.com/clean-webpack-plugin/-/clean-webpack-plugin-0.1.19.tgz#ceda8bb96b00fe168e9b080272960d20fdcadd6d" + dependencies: + rimraf "^2.6.1" + cli-cursor@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" @@ -1614,6 +1620,10 @@ clone@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.1.tgz#d217d1e961118e3ac9a4b8bba3285553bf647cdb" +clone@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -3526,12 +3536,12 @@ gulp-clean-css@^3.9.3: through2 "2.0.3" vinyl-sourcemaps-apply "0.2.1" -gulp-less@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/gulp-less/-/gulp-less-4.0.0.tgz#3c49deb96bdca913e436921ef792fb4c24296fcd" +gulp-less@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/gulp-less/-/gulp-less-4.0.1.tgz#348c33a5dde7a207c5771b1d8261d1ac1021ceed" dependencies: accord "^0.29.0" - less "2.6.x || ^3.0.0" + less "2.6.x || ^3.7.1" object-assign "^4.0.1" plugin-error "^0.1.2" replace-ext "^1.0.0" @@ -4678,9 +4688,11 @@ less-loader@^4.0.6: loader-utils "^1.1.0" pify "^3.0.0" -"less@2.6.x || ^3.0.0": - version "3.0.4" - resolved "https://registry.yarnpkg.com/less/-/less-3.0.4.tgz#d27dcedbac96031c9e7b76f1da1e4b7d83760814" +"less@2.6.x || ^3.7.1": + version "3.8.1" + resolved "https://registry.yarnpkg.com/less/-/less-3.8.1.tgz#f31758598ef5a1930dd4caefa9e4340641e71e1d" + dependencies: + clone "^2.1.2" optionalDependencies: errno "^0.1.1" graceful-fs "^4.1.2" From 6d9afa9c19e64cca95e2718dbdd2e3767ff7570b Mon Sep 17 00:00:00 2001 From: yangd Date: Thu, 30 Aug 2018 16:39:36 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9d.ts=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E7=B1=BB=E5=90=8D,=E5=B9=B6=E6=B7=BB=E5=8A=A0=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E6=96=B9=E6=B3=95=E7=9A=84d.ts=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/affix.d.ts | 2 +- types/alert.d.ts | 2 +- types/anchor.d.ts | 2 +- types/auto-complete.d.ts | 2 +- types/avatar.d.ts | 2 +- types/back-top.d.ts | 2 +- types/badge.d.ts | 2 +- types/breadcrumb.d.ts | 2 +- types/button.d.ts | 2 +- types/card.d.ts | 2 +- types/carousel.d.ts | 6 +- types/cascader.d.ts | 2 +- types/cell.d.ts | 2 +- types/checkbox.d.ts | 2 +- types/circle.d.ts | 2 +- types/collapse.d.ts | 2 +- types/color-picker.d.ts | 2 +- types/content.d.ts | 8 ++ types/date-picker.d.ts | 2 +- types/divider.d.ts | 2 +- types/drawer.d.ts | 8 ++ types/dropdown.d.ts | 5 +- types/footer.d.ts | 8 ++ types/form.d.ts | 2 +- types/grid.d.ts | 6 +- types/header.d.ts | 8 ++ types/icon.d.ts | 2 +- types/index.d.ts | 4 +- types/input-number.d.ts | 2 +- types/input.d.ts | 2 +- types/iview.components.d.ts | 232 ++++++++++++++---------------------- types/layout.d.ts | 2 +- types/loading-bar.d.ts | 8 +- types/menu.d.ts | 4 +- types/message.d.ts | 6 +- types/modal.d.ts | 4 +- types/notice.d.ts | 6 +- types/page.d.ts | 2 +- types/poptip.d.ts | 2 +- types/progress.d.ts | 2 +- types/radio.d.ts | 2 +- types/rate.d.ts | 2 +- types/scroll.d.ts | 2 +- types/select.d.ts | 6 +- types/sider.d.ts | 8 ++ types/slider.d.ts | 2 +- types/spin.d.ts | 11 +- types/split.d.ts | 2 +- types/steps.d.ts | 4 +- types/switch.d.ts | 2 +- types/table.d.ts | 2 +- types/tabs.d.ts | 4 +- types/tag.d.ts | 2 +- types/time-picker.d.ts | 2 +- types/time.ts | 2 +- types/timeline.d.ts | 2 +- types/tooltip.d.ts | 2 +- types/transfer.d.ts | 2 +- types/tree.d.ts | 2 +- types/upload.d.ts | 2 +- 60 files changed, 216 insertions(+), 212 deletions(-) create mode 100644 types/content.d.ts create mode 100644 types/drawer.d.ts create mode 100644 types/footer.d.ts create mode 100644 types/header.d.ts create mode 100644 types/sider.d.ts diff --git a/types/affix.d.ts b/types/affix.d.ts index a712a3a6..edef0c3d 100644 --- a/types/affix.d.ts +++ b/types/affix.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Affix extends Vue { /** diff --git a/types/alert.d.ts b/types/alert.d.ts index 77121c58..ce05b209 100644 --- a/types/alert.d.ts +++ b/types/alert.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Alert extends Vue { /** diff --git a/types/anchor.d.ts b/types/anchor.d.ts index 7607ebcd..f93871f6 100644 --- a/types/anchor.d.ts +++ b/types/anchor.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Anchor extends Vue { /** diff --git a/types/auto-complete.d.ts b/types/auto-complete.d.ts index c87a37b5..da5d7a5e 100644 --- a/types/auto-complete.d.ts +++ b/types/auto-complete.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class AutoComplete extends Vue { /** diff --git a/types/avatar.d.ts b/types/avatar.d.ts index e62e53c3..89de322a 100644 --- a/types/avatar.d.ts +++ b/types/avatar.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Avatar extends Vue { /** diff --git a/types/back-top.d.ts b/types/back-top.d.ts index 7f2bdaa3..78726e87 100644 --- a/types/back-top.d.ts +++ b/types/back-top.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class BackTop extends Vue { /** diff --git a/types/badge.d.ts b/types/badge.d.ts index 2c8edc37..b3efd1fc 100644 --- a/types/badge.d.ts +++ b/types/badge.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Badge extends Vue { /** diff --git a/types/breadcrumb.d.ts b/types/breadcrumb.d.ts index f7af8b2f..28fc3cdb 100644 --- a/types/breadcrumb.d.ts +++ b/types/breadcrumb.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Breadcrumb extends Vue { /** diff --git a/types/button.d.ts b/types/button.d.ts index 28859b2e..b5084a31 100644 --- a/types/button.d.ts +++ b/types/button.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Button extends Vue { /** diff --git a/types/card.d.ts b/types/card.d.ts index 7a3ce374..73e978b3 100644 --- a/types/card.d.ts +++ b/types/card.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Card extends Vue { /** diff --git a/types/carousel.d.ts b/types/carousel.d.ts index eaf3cb31..eb466b88 100644 --- a/types/carousel.d.ts +++ b/types/carousel.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Carousel extends Vue { /** @@ -58,4 +58,8 @@ export declare class Carousel extends Vue { * 幻灯片切换时触发,目前激活的幻灯片的索引,原幻灯片的索引 */ $emit(eventName: 'on-change', oldValue: number, value: number): this; +} + +export declare class CarouselItem extends Vue { + } \ No newline at end of file diff --git a/types/cascader.d.ts b/types/cascader.d.ts index 91720ca3..0c6561fe 100644 --- a/types/cascader.d.ts +++ b/types/cascader.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Cascader extends Vue { /** diff --git a/types/cell.d.ts b/types/cell.d.ts index 866b5e19..9fa0fb82 100644 --- a/types/cell.d.ts +++ b/types/cell.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Cell extends Vue { /** diff --git a/types/checkbox.d.ts b/types/checkbox.d.ts index adf0f457..581660e4 100644 --- a/types/checkbox.d.ts +++ b/types/checkbox.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Checkbox extends Vue { /** diff --git a/types/circle.d.ts b/types/circle.d.ts index 57d8e0f0..9dd7beb4 100644 --- a/types/circle.d.ts +++ b/types/circle.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Circle extends Vue { /** diff --git a/types/collapse.d.ts b/types/collapse.d.ts index f0badd08..92378f74 100644 --- a/types/collapse.d.ts +++ b/types/collapse.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Collapse extends Vue { /** diff --git a/types/color-picker.d.ts b/types/color-picker.d.ts index 8693e616..0a570f65 100644 --- a/types/color-picker.d.ts +++ b/types/color-picker.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class ColorPicker extends Vue { /** diff --git a/types/content.d.ts b/types/content.d.ts new file mode 100644 index 00000000..3d902fba --- /dev/null +++ b/types/content.d.ts @@ -0,0 +1,8 @@ +// Type definitions for iview 3.0.1 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from 'vue'; + +export declare class Content extends Vue { +} \ No newline at end of file diff --git a/types/date-picker.d.ts b/types/date-picker.d.ts index 9d69dbcc..544384cd 100644 --- a/types/date-picker.d.ts +++ b/types/date-picker.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class DatePicker extends Vue { /** diff --git a/types/divider.d.ts b/types/divider.d.ts index 1dc163c4..8c2c8cfd 100644 --- a/types/divider.d.ts +++ b/types/divider.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Divider extends Vue { /** diff --git a/types/drawer.d.ts b/types/drawer.d.ts new file mode 100644 index 00000000..16796be6 --- /dev/null +++ b/types/drawer.d.ts @@ -0,0 +1,8 @@ +// Type definitions for iview 3.0.1 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from 'vue'; + +export declare class Drawer extends Vue { +} \ No newline at end of file diff --git a/types/dropdown.d.ts b/types/dropdown.d.ts index 14d9acc8..9565c264 100644 --- a/types/dropdown.d.ts +++ b/types/dropdown.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Dropdown extends Vue { /** @@ -56,6 +56,9 @@ export declare class Dropdown extends Vue { }; } +export declare class DropdownMenu extends Vue { +} + export declare class DropdownItem extends Vue { /** * 用来标识这一项 diff --git a/types/footer.d.ts b/types/footer.d.ts new file mode 100644 index 00000000..3d8532b1 --- /dev/null +++ b/types/footer.d.ts @@ -0,0 +1,8 @@ +// Type definitions for iview 3.0.1 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from 'vue'; + +export declare class Footer extends Vue { +} \ No newline at end of file diff --git a/types/form.d.ts b/types/form.d.ts index 1829a0e9..34425de9 100644 --- a/types/form.d.ts +++ b/types/form.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Form extends Vue { /** diff --git a/types/grid.d.ts b/types/grid.d.ts index f038c622..af2bc8e7 100644 --- a/types/grid.d.ts +++ b/types/grid.d.ts @@ -2,9 +2,9 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; -export declare class GridRow extends Vue { +export declare class Row extends Vue { /** * 栅格间距,单位 px,左右平分 * @default 0 @@ -28,7 +28,7 @@ export declare class GridRow extends Vue { 'class-name'?: string; } -export declare class GridCol extends Vue { +export declare class Col extends Vue { /** * 栅格的占位格数,可选值为0~24的整数,为 0 时,相当于display:none */ diff --git a/types/header.d.ts b/types/header.d.ts new file mode 100644 index 00000000..31de7de8 --- /dev/null +++ b/types/header.d.ts @@ -0,0 +1,8 @@ +// Type definitions for iview 3.0.1 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from 'vue'; + +export declare class Header extends Vue { +} \ No newline at end of file diff --git a/types/icon.d.ts b/types/icon.d.ts index 767958a0..461376fd 100644 --- a/types/icon.d.ts +++ b/types/icon.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Icon extends Vue { /** diff --git a/types/index.d.ts b/types/index.d.ts index 46d6878b..779095e9 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -2,9 +2,9 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import iView from "./iview"; +import iView from './iview'; export default iView; export as namespace iView; -export * from "./iview.components"; \ No newline at end of file +export * from './iview.components'; \ No newline at end of file diff --git a/types/input-number.d.ts b/types/input-number.d.ts index af150ddd..7bd0ceca 100644 --- a/types/input-number.d.ts +++ b/types/input-number.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class InputNumber extends Vue { /** diff --git a/types/input.d.ts b/types/input.d.ts index 201c6a96..9553f7b6 100644 --- a/types/input.d.ts +++ b/types/input.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Input extends Vue { /** diff --git a/types/iview.components.d.ts b/types/iview.components.d.ts index a5a7ba33..390db306 100644 --- a/types/iview.components.d.ts +++ b/types/iview.components.d.ts @@ -1,143 +1,91 @@ -import { Affix } from "./affix"; -import { Alert } from "./alert"; -import { Anchor, AnchorLink } from "./anchor"; -import { AutoComplete } from "./auto-complete"; -import { Avatar } from "./avatar"; -import { BackTop } from "./back-top"; -import { Badge } from "./badge"; -import { Breadcrumb, BreadcrumbItem } from "./breadcrumb"; -import { Button, ButtonGroup } from "./button"; -import { Card } from "./card"; -import { Carousel } from "./carousel"; -import { Cascader } from "./cascader"; -import { Cell, CellGroup } from "./cell"; -import { Checkbox, CheckboxGroup } from "./checkbox"; -import { Circle } from "./circle"; -import { Collapse, CollapsePanel } from "./collapse"; -import { ColorPicker } from "./color-picker"; -import { DatePicker, DatePickerOptions } from "./date-picker"; -import { Divider } from "./divider"; -import { Dropdown, DropdownItem } from "./dropdown"; -import { Form, FormItem } from "./form"; -import { GridRow, GridCol } from "./grid"; -import { Icon } from "./icon"; -import { Input } from "./input"; -import { InputNumber } from "./input-number"; -import { Layout } from "./layout"; -import { LoadingBarInstance, LoadingBarConfig } from "./loading-bar"; -import { Menu, MenuItem, Submenu, MenuGroup } from "./menu"; -import { MessageInstance, MessageConfig } from "./message"; -import { Modal, ModalInstance, ModalConfig } from "./modal"; -import { NoticeInstance, NoticeConfig, NoticeGlobalConfig } from "./notice"; -import { Page } from "./page"; -import { Poptip } from "./poptip"; -import { Progress } from "./progress"; -import { Radio, RadioGroup } from "./radio"; -import { Rate } from "./rate"; -import { Scroll } from "./scroll"; -import { Select, SelectOption, SelectOptionGroup } from "./select"; -import { Spin } from "./spin"; -import { Split } from "./split"; -import { Steps, Step } from "./steps"; -import { Switch } from "./switch"; -import { - Table, - TableColumn, - TableRenderCreateElementData, - TableRenderCreateElementResult, - TableColumnRenderParams, - TableExportCsvParams -} from "./table"; -import { Tabs, TabPane } from "./tabs"; -import { Tag } from "./tag"; -import { Time } from "./time"; -import { Timeline, TimelineItem } from "./timeline"; -import { TimePicker } from "./time-picker"; -import { Tooltip } from "./tooltip"; -import { Transfer } from "./transfer"; -import { Tree, TreeChild } from "./tree"; -import { Upload } from "./upload"; +// Type definitions for iview 3.0.1 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue from 'vue'; -export class IAffix extends Affix {} -export class IAlert extends Alert {} -export class IAnchor extends Anchor {} -export class IAnchorLink extends AnchorLink {} -export class IAutoComplete extends AutoComplete {} -export class IAvatar extends Avatar {} -export class IBackTop extends BackTop {} -export class IBadge extends Badge {} -export class IBreadcrumb extends Breadcrumb {} -export class IBreadcrumbItem extends BreadcrumbItem {} -export class IButton extends Button {} -export class IButtonGroup extends ButtonGroup {} -export class ICard extends Card {} -export class ICarousel extends Carousel {} -export class ICascader extends Cascader {} -export class ICell extends Cell {} -export class ICellGroup extends CellGroup {} -export class ICheckbox extends Checkbox {} -export class ICheckboxGroup extends CheckboxGroup {} -export class ICircle extends Circle {} -export class ICollapse extends Collapse {} -export class ICollapsePanel extends CollapsePanel {} -export class IColorPicker extends ColorPicker {} -export class IDatePicker extends DatePicker {} -export class IDatePickerOptions extends DatePickerOptions {} -export class IDivider extends Divider {} -export class IDropdown extends Dropdown {} -export class IDropdownItem extends DropdownItem {} -export class IForm extends Form {} -export class IFormItem extends FormItem {} -export class IGridCol extends GridCol {} -export class IGridRow extends GridRow {} -export class IIcon extends Icon {} -export class IInput extends Input {} -export class IInputNumber extends InputNumber {} -export class ILayout extends Layout {} -export class ILoadingBarInstance extends LoadingBarInstance {} -export class ILoadingBarConfig extends LoadingBarConfig {} -export class IMenu extends Menu {} -export class IMenuGroup extends MenuGroup {} -export class IMenuItem extends MenuItem {} -export class IMessageConfig extends MessageConfig {} -export class IMessageInstance extends MessageInstance {} -export class IModal extends Modal {} -export class IModalConfig extends ModalConfig {} -export class IModalInstance extends ModalInstance {} -export class INoticeConfig extends NoticeConfig {} -export class INoticeGlobalConfig extends NoticeGlobalConfig {} -export class INoticeInstance extends NoticeInstance {} -export class IPage extends Page {} -export class IPoptip extends Poptip {} -export class IProgress extends Progress {} -export class IRadio extends Radio {} -export class IRadioGroup extends RadioGroup {} -export class IRate extends Rate {} -export class IScroll extends Scroll {} -export class ISelect extends Select {} -export class ISelectOption extends SelectOption {} -export class ISelectOptionGroup extends SelectOptionGroup {} -export class ISpin extends Spin {} -export class ISplit extends Split {} -export class IStep extends Step {} -export class ISteps extends Steps {} -export class ISubmenu extends Submenu {} -export class ISwitch extends Switch {} -export class ITable extends Table {} -export class ITableColumn extends TableColumn {} -export class ITableColumnRenderParams extends TableColumnRenderParams {} -export class ITableExportCsvParams extends TableExportCsvParams {} -export class ITableRenderCreateElementData extends TableRenderCreateElementData {} -export class ITableRenderCreateElementResult extends TableRenderCreateElementResult {} -export class ITabPane extends TabPane {} -export class ITabs extends Tabs {} -export class ITag extends Tag {} -export class ITime extends Time {} -export class ITimeline extends Timeline {} -export class ITimelineItem extends TimelineItem {} -export class ITimePicker extends TimePicker {} -export class ITooltip extends Tooltip {} -export class ITransfer extends Transfer {} -export class ITree extends Tree {} -export class ITreeChild extends TreeChild {} -export class IUpload extends Upload {} +export { Affix } from './affix'; +export { Alert } from './alert'; +export { Anchor, AnchorLink } from './anchor'; +export { AutoComplete } from './auto-complete'; +export { Avatar } from './avatar'; +export { BackTop } from './back-top'; +export { Badge } from './badge'; +export { Breadcrumb, BreadcrumbItem } from './breadcrumb'; +export { Button, ButtonGroup } from './button'; +export { Card } from './card'; +export { Carousel, CarouselItem } from './carousel'; +export { Cascader } from './cascader'; +export { Cell, CellGroup } from './cell'; +export { Checkbox, CheckboxGroup } from './checkbox'; +export { Circle, Circle as ICircle } from './circle'; +export { Collapse, CollapsePanel } from './collapse'; +export { ColorPicker } from './color-picker'; +export { Content } from './content'; +export { DatePicker } from './date-picker'; +export { Divider } from './divider'; +export { Drawer } from './drawer'; +export { Dropdown, DropdownMenu, DropdownItem } from './dropdown'; +export { Footer } from './footer'; +export { Form, FormItem } from './form'; +export { Header } from './header'; +export { Icon } from './icon'; +export { Input } from './input'; +export { InputNumber } from './input-number'; +export { Scroll } from './scroll'; +export { Split } from './split'; +export { Layout } from './layout'; +export { LoadingBar } from './loading-bar'; +export { Menu, MenuGroup, MenuItem, MenuSub } from './menu'; +export { Message } from './message'; +export { Modal } from './modal'; +export { Notice } from './notice'; +export { Page } from './page'; +export { Poptip } from './poptip'; +export { Progress } from './progress'; +export { Radio, RadioGroup } from './radio'; +export { Rate } from './rate'; +export { Sider } from './sider'; +export { Slider } from './slider'; +export { Spin } from './spin'; +export { Steps, StepsStep } from './steps'; +export { Switch, Switch as ISwitch } from './switch'; +export { Table } from './table'; +export { Tabs, TabsPane } from './tabs'; +export { Tag } from './tag'; +export { Time } from './time'; +export { Timeline, TimelineItem } from './timeline'; +export { TimePicker } from './time-picker'; +export { Tooltip } from './tooltip'; +export { Transfer } from './transfer'; +export { Tree } from './tree'; +export { Upload } from './upload'; +export { Row, Col } from './grid'; +export { Select, Option, OptionGroup } from './select'; + +declare const API: { + version: string; + locale: (l) => void; + i18n: (fn) => void; + install: ( + Vue: Vue, + opts: { + locale?: any; + i18n?: any; + size?: any; + transfer?: any; + } + ) => void; + lang: (code: string) => void; +}; + +export default API; + +declare module 'vue/types/vue' { + interface Vue { + $IVIEW?: { + size?: string; + transfer?: string; + }; + } +} diff --git a/types/layout.d.ts b/types/layout.d.ts index 56e353b6..68c3cbe8 100644 --- a/types/layout.d.ts +++ b/types/layout.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Layout extends Vue { /** diff --git a/types/loading-bar.d.ts b/types/loading-bar.d.ts index 0c7483da..fef4eefc 100644 --- a/types/loading-bar.d.ts +++ b/types/loading-bar.d.ts @@ -2,9 +2,9 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; -export declare class LoadingBarInstance { +export declare class LoadingBar { /** * 开始从 0 显示进度条,并自动加载进度 */ @@ -51,11 +51,11 @@ export declare class LoadingBarConfig { height?: number; } -declare module "vue/types/vue" { +declare module 'vue/types/vue' { interface Vue { /** * 加载进度条 */ - $Loading?: LoadingBarInstance; + $Loading?: LoadingBar; } } \ No newline at end of file diff --git a/types/menu.d.ts b/types/menu.d.ts index 8a1ca054..2e0eac0f 100644 --- a/types/menu.d.ts +++ b/types/menu.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Menu extends Vue { /** @@ -73,7 +73,7 @@ export declare class MenuItem extends Vue { target?: '_blank' | '_self' | '_parent' | '_top'; } -export declare class Submenu extends Vue { +export declare class MenuSub extends Vue { /** * 子菜单的唯一标识,必填 */ diff --git a/types/message.d.ts b/types/message.d.ts index 76e4d100..4f2e3bda 100644 --- a/types/message.d.ts +++ b/types/message.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode, CreateElement } from "vue"; -export declare class MessageInstance { +export declare class Message { /** * 消息 * @param config MessageConfig为相关配置,string为待显示的内容 @@ -71,12 +71,12 @@ export declare class MessageConfig { duration?: number; } -declare module "vue/types/vue" { +declare module 'vue/types/vue' { interface Vue { /** * 全局提示 */ - $Message?: MessageInstance; + $Message?: Message; } } diff --git a/types/modal.d.ts b/types/modal.d.ts index 89972948..c8c26173 100644 --- a/types/modal.d.ts +++ b/types/modal.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Modal { /** @@ -208,7 +208,7 @@ export declare class ModalConfig { onCancel?: () => void; } -declare module "vue/types/vue" { +declare module 'vue/types/vue' { interface Vue { /** * 对话框 diff --git a/types/notice.d.ts b/types/notice.d.ts index e6cf8518..0873fe9d 100644 --- a/types/notice.d.ts +++ b/types/notice.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/yangdan8/iview.git import Vue, { VNode, CreateElement } from "vue"; -export declare class NoticeInstance { +export declare class Notice { /** * 打开 * @param config NoticeConfig为相关配置,string为待显示的内容 @@ -82,11 +82,11 @@ export declare class NoticeGlobalConfig { duration?: number; } -declare module "vue/types/vue" { +declare module 'vue/types/vue' { interface Vue { /** * 通知提醒 */ - $Notice?: NoticeInstance; + $Notice?: Notice; } } \ No newline at end of file diff --git a/types/page.d.ts b/types/page.d.ts index 87268180..bca0dd3b 100644 --- a/types/page.d.ts +++ b/types/page.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Page extends Vue { /** diff --git a/types/poptip.d.ts b/types/poptip.d.ts index 54be59d0..90b462d3 100644 --- a/types/poptip.d.ts +++ b/types/poptip.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Poptip extends Vue { /** diff --git a/types/progress.d.ts b/types/progress.d.ts index c380a5bf..79c53a6d 100644 --- a/types/progress.d.ts +++ b/types/progress.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Progress extends Vue { /** diff --git a/types/radio.d.ts b/types/radio.d.ts index 108443a4..749ecc42 100644 --- a/types/radio.d.ts +++ b/types/radio.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Radio extends Vue { /** diff --git a/types/rate.d.ts b/types/rate.d.ts index 7b5f455c..e4d26741 100644 --- a/types/rate.d.ts +++ b/types/rate.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Rate extends Vue { /** diff --git a/types/scroll.d.ts b/types/scroll.d.ts index 54f7d574..5668a710 100644 --- a/types/scroll.d.ts +++ b/types/scroll.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Scroll extends Vue { /** diff --git a/types/select.d.ts b/types/select.d.ts index 789a05ac..67b8ec3e 100644 --- a/types/select.d.ts +++ b/types/select.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Select extends Vue { /** @@ -114,7 +114,7 @@ export declare class Select extends Vue { clearSingleSelect(): void; } -export declare class SelectOption extends Vue { +export declare class Option extends Vue { /** * 选项值,默认根据此属性值进行筛选,必填 */ @@ -132,7 +132,7 @@ export declare class SelectOption extends Vue { disabled?: boolean; } -export declare class SelectOptionGroup extends Vue { +export declare class OptionGroup extends Vue { /** * 分组的组名 * @default 空 diff --git a/types/sider.d.ts b/types/sider.d.ts new file mode 100644 index 00000000..7a53986a --- /dev/null +++ b/types/sider.d.ts @@ -0,0 +1,8 @@ +// Type definitions for iview 3.0.1 +// Project: https://github.com/iview/iview +// Definitions by: yangdan +// Definitions: https://github.com/yangdan8/iview.git +import Vue, { VNode } from 'vue'; + +export declare class Sider extends Vue { +} \ No newline at end of file diff --git a/types/slider.d.ts b/types/slider.d.ts index 8d2cbd38..a68a87fa 100644 --- a/types/slider.d.ts +++ b/types/slider.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Slider extends Vue { /** diff --git a/types/spin.d.ts b/types/spin.d.ts index 7e7d48ac..9b6f4fc0 100644 --- a/types/spin.d.ts +++ b/types/spin.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Spin extends Vue { /** @@ -23,4 +23,13 @@ export declare class Spin extends Vue { */ '': VNode[]; }; +} + +declare module 'vue/types/vue' { + interface Vue { + /** + * + */ + $Spin?: Spin; + } } \ No newline at end of file diff --git a/types/split.d.ts b/types/split.d.ts index f939b573..c5b3a5e1 100644 --- a/types/split.d.ts +++ b/types/split.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Split extends Vue { /** diff --git a/types/steps.d.ts b/types/steps.d.ts index 75749977..16c6ae72 100644 --- a/types/steps.d.ts +++ b/types/steps.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Steps extends Vue { /** @@ -26,7 +26,7 @@ export declare class Steps extends Vue { direction?: 'horizontal' | 'vertical'; } -export declare class Step extends Vue { +export declare class StepsStep extends Vue { /** * 步骤的状态,可选值为wait、process、finish、error,不设置时自动判断 * @default process diff --git a/types/switch.d.ts b/types/switch.d.ts index c1435849..6a54a20a 100644 --- a/types/switch.d.ts +++ b/types/switch.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Switch extends Vue { /** diff --git a/types/table.d.ts b/types/table.d.ts index 35908740..32626298 100644 --- a/types/table.d.ts +++ b/types/table.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Table extends Vue { /** diff --git a/types/tabs.d.ts b/types/tabs.d.ts index 1be00a8c..55f04ce6 100644 --- a/types/tabs.d.ts +++ b/types/tabs.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Tabs extends Vue { /** @@ -54,7 +54,7 @@ export declare class Tabs extends Vue { }; } -export declare class TabPane extends Vue { +export declare class TabsPane extends Vue { /** * 用于标识当前面板,对应 value,默认为其索引值 */ diff --git a/types/tag.d.ts b/types/tag.d.ts index cc3fd9ca..9db360ab 100644 --- a/types/tag.d.ts +++ b/types/tag.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Tag extends Vue { /** diff --git a/types/time-picker.d.ts b/types/time-picker.d.ts index 22b973bc..3b1b3ad5 100644 --- a/types/time-picker.d.ts +++ b/types/time-picker.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class TimePicker extends Vue { /** diff --git a/types/time.ts b/types/time.ts index d5b2a1f2..34365e1b 100644 --- a/types/time.ts +++ b/types/time.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Time extends Vue { /** diff --git a/types/timeline.d.ts b/types/timeline.d.ts index 5f036faf..7d28784b 100644 --- a/types/timeline.d.ts +++ b/types/timeline.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Timeline extends Vue { /** diff --git a/types/tooltip.d.ts b/types/tooltip.d.ts index 477f9f8a..05300181 100644 --- a/types/tooltip.d.ts +++ b/types/tooltip.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Tooltip extends Vue { /** diff --git a/types/transfer.d.ts b/types/transfer.d.ts index 95c9d006..e40ace49 100644 --- a/types/transfer.d.ts +++ b/types/transfer.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Transfer extends Vue { /** diff --git a/types/tree.d.ts b/types/tree.d.ts index 65b219cc..2d25fd1f 100644 --- a/types/tree.d.ts +++ b/types/tree.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Tree extends Vue { /** diff --git a/types/upload.d.ts b/types/upload.d.ts index 7696eeff..835da693 100644 --- a/types/upload.d.ts +++ b/types/upload.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from "vue"; +import Vue, { VNode } from 'vue'; export declare class Upload extends Vue { /** From 438e24d78b2b7165b23749cff7b74f6025fd2d73 Mon Sep 17 00:00:00 2001 From: yangd Date: Thu, 30 Aug 2018 16:45:58 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E4=B8=8D=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E7=94=A8=E5=88=B0=E7=9A=84=E5=AF=BC=E5=87=BAVNode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/affix.d.ts | 2 +- types/alert.d.ts | 2 +- types/anchor.d.ts | 2 +- types/auto-complete.d.ts | 2 +- types/avatar.d.ts | 2 +- types/back-top.d.ts | 2 +- types/badge.d.ts | 2 +- types/breadcrumb.d.ts | 2 +- types/button.d.ts | 2 +- types/card.d.ts | 2 +- types/carousel.d.ts | 2 +- types/cascader.d.ts | 2 +- types/cell.d.ts | 2 +- types/checkbox.d.ts | 2 +- types/circle.d.ts | 2 +- types/collapse.d.ts | 2 +- types/color-picker.d.ts | 2 +- types/content.d.ts | 2 +- types/date-picker.d.ts | 2 +- types/divider.d.ts | 2 +- types/drawer.d.ts | 2 +- types/dropdown.d.ts | 2 +- types/footer.d.ts | 2 +- types/form.d.ts | 2 +- types/grid.d.ts | 2 +- types/header.d.ts | 2 +- types/icon.d.ts | 2 +- types/input-number.d.ts | 2 +- types/input.d.ts | 2 +- types/layout.d.ts | 2 +- types/loading-bar.d.ts | 2 +- types/menu.d.ts | 2 +- types/modal.d.ts | 2 +- types/page.d.ts | 2 +- types/poptip.d.ts | 2 +- types/progress.d.ts | 2 +- types/radio.d.ts | 2 +- types/rate.d.ts | 2 +- types/scroll.d.ts | 2 +- types/select.d.ts | 2 +- types/sider.d.ts | 2 +- types/slider.d.ts | 2 +- types/spin.d.ts | 2 +- types/split.d.ts | 2 +- types/steps.d.ts | 2 +- types/switch.d.ts | 2 +- types/table.d.ts | 2 +- types/tabs.d.ts | 2 +- types/tag.d.ts | 2 +- types/time-picker.d.ts | 2 +- types/time.ts | 2 +- types/timeline.d.ts | 2 +- types/tooltip.d.ts | 2 +- types/transfer.d.ts | 2 +- types/tree.d.ts | 2 +- types/upload.d.ts | 2 +- 56 files changed, 56 insertions(+), 56 deletions(-) diff --git a/types/affix.d.ts b/types/affix.d.ts index edef0c3d..d4f7d364 100644 --- a/types/affix.d.ts +++ b/types/affix.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Affix extends Vue { /** diff --git a/types/alert.d.ts b/types/alert.d.ts index ce05b209..1135a928 100644 --- a/types/alert.d.ts +++ b/types/alert.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Alert extends Vue { /** diff --git a/types/anchor.d.ts b/types/anchor.d.ts index f93871f6..9a5c996b 100644 --- a/types/anchor.d.ts +++ b/types/anchor.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Anchor extends Vue { /** diff --git a/types/auto-complete.d.ts b/types/auto-complete.d.ts index da5d7a5e..33d29753 100644 --- a/types/auto-complete.d.ts +++ b/types/auto-complete.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class AutoComplete extends Vue { /** diff --git a/types/avatar.d.ts b/types/avatar.d.ts index 89de322a..81533937 100644 --- a/types/avatar.d.ts +++ b/types/avatar.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Avatar extends Vue { /** diff --git a/types/back-top.d.ts b/types/back-top.d.ts index 78726e87..862d044c 100644 --- a/types/back-top.d.ts +++ b/types/back-top.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class BackTop extends Vue { /** diff --git a/types/badge.d.ts b/types/badge.d.ts index b3efd1fc..36f253f2 100644 --- a/types/badge.d.ts +++ b/types/badge.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Badge extends Vue { /** diff --git a/types/breadcrumb.d.ts b/types/breadcrumb.d.ts index 28fc3cdb..b904b496 100644 --- a/types/breadcrumb.d.ts +++ b/types/breadcrumb.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Breadcrumb extends Vue { /** diff --git a/types/button.d.ts b/types/button.d.ts index b5084a31..282d5978 100644 --- a/types/button.d.ts +++ b/types/button.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Button extends Vue { /** diff --git a/types/card.d.ts b/types/card.d.ts index 73e978b3..30f3d80c 100644 --- a/types/card.d.ts +++ b/types/card.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Card extends Vue { /** diff --git a/types/carousel.d.ts b/types/carousel.d.ts index eb466b88..a9e0a275 100644 --- a/types/carousel.d.ts +++ b/types/carousel.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Carousel extends Vue { /** diff --git a/types/cascader.d.ts b/types/cascader.d.ts index 0c6561fe..f889c222 100644 --- a/types/cascader.d.ts +++ b/types/cascader.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Cascader extends Vue { /** diff --git a/types/cell.d.ts b/types/cell.d.ts index 9fa0fb82..6d33a25d 100644 --- a/types/cell.d.ts +++ b/types/cell.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Cell extends Vue { /** diff --git a/types/checkbox.d.ts b/types/checkbox.d.ts index 581660e4..3b4cbcd5 100644 --- a/types/checkbox.d.ts +++ b/types/checkbox.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Checkbox extends Vue { /** diff --git a/types/circle.d.ts b/types/circle.d.ts index 9dd7beb4..0679240e 100644 --- a/types/circle.d.ts +++ b/types/circle.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Circle extends Vue { /** diff --git a/types/collapse.d.ts b/types/collapse.d.ts index 92378f74..48aa124e 100644 --- a/types/collapse.d.ts +++ b/types/collapse.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Collapse extends Vue { /** diff --git a/types/color-picker.d.ts b/types/color-picker.d.ts index 0a570f65..ca377bf7 100644 --- a/types/color-picker.d.ts +++ b/types/color-picker.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class ColorPicker extends Vue { /** diff --git a/types/content.d.ts b/types/content.d.ts index 3d902fba..7da49f3d 100644 --- a/types/content.d.ts +++ b/types/content.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Content extends Vue { } \ No newline at end of file diff --git a/types/date-picker.d.ts b/types/date-picker.d.ts index 544384cd..99118920 100644 --- a/types/date-picker.d.ts +++ b/types/date-picker.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class DatePicker extends Vue { /** diff --git a/types/divider.d.ts b/types/divider.d.ts index 8c2c8cfd..a847e517 100644 --- a/types/divider.d.ts +++ b/types/divider.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Divider extends Vue { /** diff --git a/types/drawer.d.ts b/types/drawer.d.ts index 16796be6..0c4287db 100644 --- a/types/drawer.d.ts +++ b/types/drawer.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Drawer extends Vue { } \ No newline at end of file diff --git a/types/dropdown.d.ts b/types/dropdown.d.ts index 9565c264..c795a2f0 100644 --- a/types/dropdown.d.ts +++ b/types/dropdown.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Dropdown extends Vue { /** diff --git a/types/footer.d.ts b/types/footer.d.ts index 3d8532b1..3f00502b 100644 --- a/types/footer.d.ts +++ b/types/footer.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Footer extends Vue { } \ No newline at end of file diff --git a/types/form.d.ts b/types/form.d.ts index 34425de9..8800c055 100644 --- a/types/form.d.ts +++ b/types/form.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Form extends Vue { /** diff --git a/types/grid.d.ts b/types/grid.d.ts index af2bc8e7..8282459e 100644 --- a/types/grid.d.ts +++ b/types/grid.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Row extends Vue { /** diff --git a/types/header.d.ts b/types/header.d.ts index 31de7de8..47095538 100644 --- a/types/header.d.ts +++ b/types/header.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Header extends Vue { } \ No newline at end of file diff --git a/types/icon.d.ts b/types/icon.d.ts index 461376fd..08954b4b 100644 --- a/types/icon.d.ts +++ b/types/icon.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Icon extends Vue { /** diff --git a/types/input-number.d.ts b/types/input-number.d.ts index 7bd0ceca..9f12f6d4 100644 --- a/types/input-number.d.ts +++ b/types/input-number.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class InputNumber extends Vue { /** diff --git a/types/input.d.ts b/types/input.d.ts index 9553f7b6..3cd8c37c 100644 --- a/types/input.d.ts +++ b/types/input.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Input extends Vue { /** diff --git a/types/layout.d.ts b/types/layout.d.ts index 68c3cbe8..a2baf9be 100644 --- a/types/layout.d.ts +++ b/types/layout.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Layout extends Vue { /** diff --git a/types/loading-bar.d.ts b/types/loading-bar.d.ts index fef4eefc..f12e9b87 100644 --- a/types/loading-bar.d.ts +++ b/types/loading-bar.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class LoadingBar { /** diff --git a/types/menu.d.ts b/types/menu.d.ts index 2e0eac0f..f4649644 100644 --- a/types/menu.d.ts +++ b/types/menu.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Menu extends Vue { /** diff --git a/types/modal.d.ts b/types/modal.d.ts index c8c26173..80f78a8a 100644 --- a/types/modal.d.ts +++ b/types/modal.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Modal { /** diff --git a/types/page.d.ts b/types/page.d.ts index bca0dd3b..61fdb47e 100644 --- a/types/page.d.ts +++ b/types/page.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Page extends Vue { /** diff --git a/types/poptip.d.ts b/types/poptip.d.ts index 90b462d3..06ebaf08 100644 --- a/types/poptip.d.ts +++ b/types/poptip.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Poptip extends Vue { /** diff --git a/types/progress.d.ts b/types/progress.d.ts index 79c53a6d..c8e076fb 100644 --- a/types/progress.d.ts +++ b/types/progress.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Progress extends Vue { /** diff --git a/types/radio.d.ts b/types/radio.d.ts index 749ecc42..3ed5bd59 100644 --- a/types/radio.d.ts +++ b/types/radio.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Radio extends Vue { /** diff --git a/types/rate.d.ts b/types/rate.d.ts index e4d26741..51e17e8a 100644 --- a/types/rate.d.ts +++ b/types/rate.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Rate extends Vue { /** diff --git a/types/scroll.d.ts b/types/scroll.d.ts index 5668a710..7a18fd56 100644 --- a/types/scroll.d.ts +++ b/types/scroll.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Scroll extends Vue { /** diff --git a/types/select.d.ts b/types/select.d.ts index 67b8ec3e..2376b146 100644 --- a/types/select.d.ts +++ b/types/select.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Select extends Vue { /** diff --git a/types/sider.d.ts b/types/sider.d.ts index 7a53986a..cdb66056 100644 --- a/types/sider.d.ts +++ b/types/sider.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Sider extends Vue { } \ No newline at end of file diff --git a/types/slider.d.ts b/types/slider.d.ts index a68a87fa..03a7dfde 100644 --- a/types/slider.d.ts +++ b/types/slider.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Slider extends Vue { /** diff --git a/types/spin.d.ts b/types/spin.d.ts index 9b6f4fc0..5312a611 100644 --- a/types/spin.d.ts +++ b/types/spin.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Spin extends Vue { /** diff --git a/types/split.d.ts b/types/split.d.ts index c5b3a5e1..48d7becc 100644 --- a/types/split.d.ts +++ b/types/split.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Split extends Vue { /** diff --git a/types/steps.d.ts b/types/steps.d.ts index 16c6ae72..8815dff2 100644 --- a/types/steps.d.ts +++ b/types/steps.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Steps extends Vue { /** diff --git a/types/switch.d.ts b/types/switch.d.ts index 6a54a20a..d67d462c 100644 --- a/types/switch.d.ts +++ b/types/switch.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Switch extends Vue { /** diff --git a/types/table.d.ts b/types/table.d.ts index 32626298..a70b9f53 100644 --- a/types/table.d.ts +++ b/types/table.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Table extends Vue { /** diff --git a/types/tabs.d.ts b/types/tabs.d.ts index 55f04ce6..c883c5a0 100644 --- a/types/tabs.d.ts +++ b/types/tabs.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Tabs extends Vue { /** diff --git a/types/tag.d.ts b/types/tag.d.ts index 9db360ab..474a18c8 100644 --- a/types/tag.d.ts +++ b/types/tag.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Tag extends Vue { /** diff --git a/types/time-picker.d.ts b/types/time-picker.d.ts index 3b1b3ad5..ca77fe56 100644 --- a/types/time-picker.d.ts +++ b/types/time-picker.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class TimePicker extends Vue { /** diff --git a/types/time.ts b/types/time.ts index 34365e1b..1490a706 100644 --- a/types/time.ts +++ b/types/time.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Time extends Vue { /** diff --git a/types/timeline.d.ts b/types/timeline.d.ts index 7d28784b..5a0ab235 100644 --- a/types/timeline.d.ts +++ b/types/timeline.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Timeline extends Vue { /** diff --git a/types/tooltip.d.ts b/types/tooltip.d.ts index 05300181..efefc5dc 100644 --- a/types/tooltip.d.ts +++ b/types/tooltip.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Tooltip extends Vue { /** diff --git a/types/transfer.d.ts b/types/transfer.d.ts index e40ace49..10014421 100644 --- a/types/transfer.d.ts +++ b/types/transfer.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Transfer extends Vue { /** diff --git a/types/tree.d.ts b/types/tree.d.ts index 2d25fd1f..b0ba5976 100644 --- a/types/tree.d.ts +++ b/types/tree.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Tree extends Vue { /** diff --git a/types/upload.d.ts b/types/upload.d.ts index 835da693..6c428641 100644 --- a/types/upload.d.ts +++ b/types/upload.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/iview/iview // Definitions by: yangdan // Definitions: https://github.com/yangdan8/iview.git -import Vue, { VNode } from 'vue'; +import Vue from 'vue'; export declare class Upload extends Vue { /**