Commit 66574d7a3afcccfeb72de1dec6d911f60a22a7bf
Committed by
GitHub
Merge pull request #5633 from yangdan8/3.4.0更新d.ts
d.ts升级到对应的iview 3.4.0版本
Showing
13 changed files
with
143 additions
and
17 deletions
Show diff stats
types/breadcrumb.d.ts
| ... | ... | @@ -27,4 +27,9 @@ export declare interface BreadcrumbItem extends Vue { |
| 27 | 27 | * @default _self |
| 28 | 28 | */ |
| 29 | 29 | target?: '_blank' | '_self' | '_parent' | '_top'; |
| 30 | + /** | |
| 31 | + * 同 vue-router append | |
| 32 | + * @default false | |
| 33 | + */ | |
| 34 | + append?: boolean; | |
| 30 | 35 | } |
| 31 | 36 | \ No newline at end of file | ... | ... |
types/button.d.ts
| ... | ... | @@ -66,6 +66,11 @@ export declare interface Button extends Vue { |
| 66 | 66 | * @default _self |
| 67 | 67 | */ |
| 68 | 68 | target?: '_blank' | '_self' | '_parent' | '_top'; |
| 69 | + /** | |
| 70 | + * 同 vue-router append | |
| 71 | + * @default false | |
| 72 | + */ | |
| 73 | + append?: boolean; | |
| 69 | 74 | } |
| 70 | 75 | |
| 71 | 76 | export declare interface ButtonGroup extends Vue { | ... | ... |
types/cell.d.ts
types/date-picker.d.ts
| ... | ... | @@ -132,6 +132,10 @@ export declare interface DatePicker extends Vue { |
| 132 | 132 | */ |
| 133 | 133 | $emit(eventName: 'on-clear'): this; |
| 134 | 134 | /** |
| 135 | + * 点击外部关闭下拉菜单时触发 | |
| 136 | + */ | |
| 137 | + $emit(eventName: 'on-clickoutside',event: MouseEvent): this; | |
| 138 | + /** | |
| 135 | 139 | * slot插槽对象 |
| 136 | 140 | */ |
| 137 | 141 | $slots: { | ... | ... |
types/dropdown.d.ts
types/input.d.ts
| ... | ... | @@ -141,6 +141,10 @@ export declare interface Input extends Vue { |
| 141 | 141 | */ |
| 142 | 142 | $emit(eventName: 'on-search', value: string): this; |
| 143 | 143 | /** |
| 144 | + * 开启 clearable 时可用,点击清空按钮时触发 | |
| 145 | + */ | |
| 146 | + $emit(eventName: 'on-clear'): this; | |
| 147 | + /** | |
| 144 | 148 | * 手动聚焦输入框 |
| 145 | 149 | */ |
| 146 | 150 | focus(): void; | ... | ... |
types/iview.components.d.ts
| ... | ... | @@ -63,18 +63,74 @@ export { Transfer } from './transfer'; |
| 63 | 63 | export { Tree, TreeChild } from './tree'; |
| 64 | 64 | export { Upload } from './upload'; |
| 65 | 65 | |
| 66 | +interface IViewGlobalOptions{ | |
| 67 | + size?: string; | |
| 68 | + transfer?: boolean | string; | |
| 69 | + select: { | |
| 70 | + arrow: string; | |
| 71 | + customArrow: string; | |
| 72 | + arrowSize: number | string; | |
| 73 | + }; | |
| 74 | + cell: { | |
| 75 | + arrow: string; | |
| 76 | + customArrow: string; | |
| 77 | + arrowSize: number | string; | |
| 78 | + }; | |
| 79 | + menu: { | |
| 80 | + arrow: string; | |
| 81 | + customArrow: string; | |
| 82 | + arrowSize: number | string; | |
| 83 | + }; | |
| 84 | + tree: { | |
| 85 | + arrow: string; | |
| 86 | + customArrow: string; | |
| 87 | + arrowSize: number | string; | |
| 88 | + }; | |
| 89 | + cascader: { | |
| 90 | + arrow: string; | |
| 91 | + customArrow: string; | |
| 92 | + arrowSize: number | string; | |
| 93 | + itemArrow: string; | |
| 94 | + customItemArrow: string; | |
| 95 | + itemArrowSize: number | string; | |
| 96 | + }; | |
| 97 | + colorPicker: { | |
| 98 | + arrow: string; | |
| 99 | + customArrow: string; | |
| 100 | + arrowSize: number | string; | |
| 101 | + }; | |
| 102 | + datePicker: { | |
| 103 | + icon: string; | |
| 104 | + customIcon: string; | |
| 105 | + iconSize: number | string; | |
| 106 | + }; | |
| 107 | + timePicker: { | |
| 108 | + icon: string; | |
| 109 | + customIcon: string; | |
| 110 | + iconSize: number | string; | |
| 111 | + }; | |
| 112 | + tabs: { | |
| 113 | + closeIcon: string; | |
| 114 | + customCloseIcon: string; | |
| 115 | + closeIconSize: number | string; | |
| 116 | + }; | |
| 117 | + modal: { | |
| 118 | + maskClosable: boolean | string; | |
| 119 | + }; | |
| 120 | +} | |
| 121 | + | |
| 122 | +interface IViewInstallOptions extends IViewGlobalOptions{ | |
| 123 | + locale?: any; | |
| 124 | + i18n?: any; | |
| 125 | +} | |
| 126 | + | |
| 66 | 127 | declare const API: { |
| 67 | 128 | version: string; |
| 68 | - locale: (l:any) => void; | |
| 69 | - i18n: (fn:any) => void; | |
| 129 | + locale: (l: any) => void; | |
| 130 | + i18n: (fn: any) => void; | |
| 70 | 131 | install: ( |
| 71 | 132 | Vue: Vue, |
| 72 | - opts: { | |
| 73 | - locale?: any; | |
| 74 | - i18n?: any; | |
| 75 | - size?: any; | |
| 76 | - transfer?: any; | |
| 77 | - } | |
| 133 | + opts: IViewInstallOptions | |
| 78 | 134 | ) => void; |
| 79 | 135 | lang: (code: string) => void; |
| 80 | 136 | }; |
| ... | ... | @@ -83,9 +139,6 @@ export default API; |
| 83 | 139 | |
| 84 | 140 | declare module 'vue/types/vue' { |
| 85 | 141 | interface Vue { |
| 86 | - $IVIEW: { | |
| 87 | - size?: string; | |
| 88 | - transfer?: string; | |
| 89 | - }; | |
| 142 | + $IVIEW: IViewGlobalOptions; | |
| 90 | 143 | } |
| 91 | 144 | } | ... | ... |
types/loading-bar.d.ts
| ... | ... | @@ -42,11 +42,6 @@ export declare interface LoadingBarConfig { |
| 42 | 42 | */ |
| 43 | 43 | color?: string; |
| 44 | 44 | /** |
| 45 | - * 自动消失的延时, 默认为800ms | |
| 46 | - * @default 800 | |
| 47 | - */ | |
| 48 | - duration?: number; | |
| 49 | - /** | |
| 50 | 45 | * 失败时的进度条颜色,默认为 iView 主色 |
| 51 | 46 | * @default error |
| 52 | 47 | */ |
| ... | ... | @@ -56,6 +51,11 @@ export declare interface LoadingBarConfig { |
| 56 | 51 | * @default 2 |
| 57 | 52 | */ |
| 58 | 53 | height?: number; |
| 54 | + /** | |
| 55 | + * 自动消失的延时, 默认为800ms | |
| 56 | + * @default 800 | |
| 57 | + */ | |
| 58 | + duration?: number; | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | declare module 'vue/types/vue' { | ... | ... |
types/menu.d.ts
| ... | ... | @@ -71,6 +71,11 @@ export declare interface MenuItem extends Vue { |
| 71 | 71 | * @default _self |
| 72 | 72 | */ |
| 73 | 73 | target?: '_blank' | '_self' | '_parent' | '_top'; |
| 74 | + /** | |
| 75 | + * 同 vue-router append | |
| 76 | + * @default false | |
| 77 | + */ | |
| 78 | + append?: boolean; | |
| 74 | 79 | } |
| 75 | 80 | |
| 76 | 81 | export declare interface MenuSub extends Vue { | ... | ... |
types/poptip.d.ts
types/select.d.ts
| ... | ... | @@ -93,6 +93,18 @@ export declare interface Select extends Vue { |
| 93 | 93 | */ |
| 94 | 94 | 'transfer-class-name'?: string; |
| 95 | 95 | /** |
| 96 | + * 在 Select 内显示图标 | |
| 97 | + */ | |
| 98 | + prefix?: string; | |
| 99 | + /** | |
| 100 | + * 多选时最多显示多少个 tag | |
| 101 | + */ | |
| 102 | + 'max-tag-count'?: number; | |
| 103 | + /** | |
| 104 | + * 隐藏 tag 时显示的内容,参数是剩余项数量 | |
| 105 | + */ | |
| 106 | + 'max-tag-placeholder'?: () => any; | |
| 107 | + /** | |
| 96 | 108 | * 选中的Option变化时触发,默认返回 value,如需返回 label,详见 label-in-value 属性 当前选中项 |
| 97 | 109 | */ |
| 98 | 110 | $emit(eventName: 'on-change'): this; |
| ... | ... | @@ -116,6 +128,15 @@ export declare interface Select extends Vue { |
| 116 | 128 | * 清空单选项,仅在 clearable="true" 时有效 |
| 117 | 129 | */ |
| 118 | 130 | clearSingleSelect(): void; |
| 131 | + /** | |
| 132 | + * slot插槽对象 | |
| 133 | + */ | |
| 134 | + $slots: { | |
| 135 | + /** | |
| 136 | + * 自定义 Select 内头部图标 | |
| 137 | + */ | |
| 138 | + prefix: VNode[]; | |
| 139 | + }; | |
| 119 | 140 | } |
| 120 | 141 | |
| 121 | 142 | export declare interface Option extends Vue { | ... | ... |
types/slider.d.ts
| ... | ... | @@ -60,6 +60,11 @@ export declare interface Slider extends Vue { |
| 60 | 60 | */ |
| 61 | 61 | 'input-size'?: '' | 'large' | 'small' | 'default'; |
| 62 | 62 | /** |
| 63 | + * 同 InputNumber 的 active-change | |
| 64 | + * @default true | |
| 65 | + */ | |
| 66 | + 'active-change'?: boolean; | |
| 67 | + /** | |
| 63 | 68 | * 在松开滑动时触发,返回当前的选值,在滑动过程中不会触发 |
| 64 | 69 | */ |
| 65 | 70 | $emit(eventName: 'on-change', value: number | number[]): this; | ... | ... |
types/table.d.ts
| ... | ... | @@ -41,6 +41,10 @@ export declare interface Table extends Vue { |
| 41 | 41 | */ |
| 42 | 42 | height?: number | string; |
| 43 | 43 | /** |
| 44 | + * 表格最大高度,单位 px,设置后,如果表格内容大于此值,会固定表头 | |
| 45 | + */ | |
| 46 | + 'max-height'?: number | string; | |
| 47 | + /** | |
| 44 | 48 | * 表格是否加载中 |
| 45 | 49 | * @default false |
| 46 | 50 | */ |
| ... | ... | @@ -86,6 +90,11 @@ export declare interface Table extends Vue { |
| 86 | 90 | */ |
| 87 | 91 | "tooltip-theme"?: string; |
| 88 | 92 | /** |
| 93 | + * 是否强制使用内置的 row-key,开启后可能会影响性能 | |
| 94 | + * @default false | |
| 95 | + */ | |
| 96 | + "row-key"?: boolean; | |
| 97 | + /** | |
| 89 | 98 | * 开启 highlight-row 后有效,当表格的当前行发生变化的时候会触发 |
| 90 | 99 | * currentRow:当前高亮行的数据 |
| 91 | 100 | * oldCurrentRow:上一次高亮的数据 | ... | ... |