Commit 97b5319192a31df6d3d6114bfe2996d2e07265e9

Authored by 梁灏
2 parents d907e840 cd3a8eee

Merge branch '2.0' of https://github.com/iview/iview into 2.0

types/message.d.ts
@@ -5,80 +5,78 @@ @@ -5,80 +5,78 @@
5 import Vue, { VNode, CreateElement } from "vue"; 5 import Vue, { VNode, CreateElement } from "vue";
6 6
7 export declare interface Message { 7 export declare interface Message {
8 - /**  
9 - * 消息  
10 - * @param config MessageConfig为相关配置,string为待显示的内容  
11 - */  
12 - info(config?: MessageConfig | string): void;  
13 - /**  
14 - * 成功  
15 - * @param config MessageConfig为相关配置,string为待显示的内容  
16 - */  
17 - success(config?: MessageConfig | string): void;  
18 - /**  
19 - * 警告  
20 - * @param config MessageConfig为相关配置,string为待显示的内容  
21 - */  
22 - warning(config?: MessageConfig | string): void;  
23 - /**  
24 - * 错误  
25 - * @param config MessageConfig为相关配置,string为待显示的内容  
26 - */  
27 - error(config?: MessageConfig | string): void;  
28 - /**  
29 - * 配置  
30 - * @param config MessageConfig为相关配置,string为待显示的内容  
31 - */  
32 - loading(options?: MessageConfig | string): void;  
33 - /**  
34 - * 配置  
35 - * @param config MessageConfig为相关配置,string为待显示的内容  
36 - */  
37 - config(options?: MessageConfig): void;  
38 - /**  
39 - * 销毁  
40 - */  
41 - destroy(): void; 8 + /**
  9 + * 消息
  10 + * @param config MessageConfig为相关配置,string为待显示的内容
  11 + */
  12 + info(config?: MessageConfig | string): void;
  13 + /**
  14 + * 成功
  15 + * @param config MessageConfig为相关配置,string为待显示的内容
  16 + */
  17 + success(config?: MessageConfig | string): void;
  18 + /**
  19 + * 警告
  20 + * @param config MessageConfig为相关配置,string为待显示的内容
  21 + */
  22 + warning(config?: MessageConfig | string): void;
  23 + /**
  24 + * 错误
  25 + * @param config MessageConfig为相关配置,string为待显示的内容
  26 + */
  27 + error(config?: MessageConfig | string): void;
  28 + /**
  29 + * 配置
  30 + * @param config MessageConfig为相关配置,string为待显示的内容
  31 + */
  32 + loading(options?: MessageConfig | string): void;
  33 + /**
  34 + * 配置
  35 + * @param config MessageConfig为相关配置,string为待显示的内容
  36 + */
  37 + config(options?: MessageConfig): void;
  38 + /**
  39 + * 销毁
  40 + */
  41 + destroy(): void;
42 } 42 }
43 43
44 export declare interface MessageConfig { 44 export declare interface MessageConfig {
45 - /**  
46 - * 提示内容  
47 - */  
48 - content?: string;  
49 - /**  
50 - * 自定义描述内容,使用 Vue 的 Render 函数  
51 - */  
52 - render?: (h: CreateElement) => VNode;  
53 - /**  
54 - * 关闭时的回调  
55 - */  
56 - onClose?: () => void;  
57 - /**  
58 - * 页面是否可以滚动  
59 - * @default false  
60 - */  
61 - closable?: boolean;  
62 - /**  
63 - * 提示组件距离顶端的距离,单位像素  
64 - * @default 24  
65 - */  
66 - top?: number;  
67 - /**  
68 - * 默认自动关闭的延时,单位秒  
69 - * @default 1.5  
70 - */  
71 - duration?: number;  
72 -}  
73 -  
74 -declare module 'vue/types/vue' {  
75 - interface Vue {  
76 /** 45 /**
77 - * 全局提示 46 + * 提示内容
  47 + */
  48 + content?: string;
  49 + /**
  50 + * 自定义描述内容,使用 Vue 的 Render 函数
  51 + * @param h Render函数
  52 + */
  53 + render?: (h?: CreateElement) => VNode;
  54 + /**
  55 + * 关闭时的回调
  56 + */
  57 + onClose?: () => void;
  58 + /**
  59 + * 页面是否可以滚动
  60 + * @default false
78 */ 61 */
79 - $Message: Message;  
80 - } 62 + closable?: boolean;
  63 + /**
  64 + * 提示组件距离顶端的距离,单位像素
  65 + * @default 24
  66 + */
  67 + top?: number;
  68 + /**
  69 + * 默认自动关闭的延时,单位秒
  70 + * @default 1.5
  71 + */
  72 + duration?: number;
81 } 73 }
82 74
83 -  
84 - 75 +declare module "vue/types/vue" {
  76 + interface Vue {
  77 + /**
  78 + * 全局提示
  79 + */
  80 + $Message: Message;
  81 + }
  82 +}
@@ -2,222 +2,223 @@ @@ -2,222 +2,223 @@
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
5 -import Vue, { VNode } from 'vue'; 5 +import Vue, { VNode, CreateElement } from "vue";
6 6
7 export declare interface Modal { 7 export declare interface Modal {
8 - /**  
9 - * 对话框是否显示,可使用 v-model 双向绑定数据。  
10 - * @default false  
11 - */  
12 - value?: boolean;  
13 - /**  
14 - * 对话框标题,如果使用 slot 自定义了页头,则 title 无效  
15 - */  
16 - title?: string;  
17 - /**  
18 - * 是否显示右上角的关闭按钮,关闭后 Esc 按键也将关闭,  
19 - * @default true  
20 - */  
21 - closable?: boolean;  
22 - /**  
23 - * 是否允许点击遮罩层关闭  
24 - * @default true  
25 - */  
26 - 'mask-closable'?: boolean;  
27 - /**  
28 - * 点击确定按钮时,确定按钮是否显示 loading 状态,开启则需手动设置visible来关闭对话框,  
29 - * @default false  
30 - */  
31 - loading?: boolean;  
32 - /**  
33 - * 页面是否可以滚动  
34 - * @default false  
35 - */  
36 - scrollable?: boolean;  
37 - /**  
38 - * 是否全屏显示  
39 - * @default false  
40 - */  
41 - fullscreen?: boolean;  
42 - /**  
43 - * 是否可以拖拽移动  
44 - * @default false  
45 - */  
46 - draggable?: boolean;  
47 - /**  
48 - * 是否显示遮罩层,开启 draggable 时,强制不显示  
49 - * @default true  
50 - */  
51 - mask?: boolean;  
52 - /**  
53 - * 确定按钮文字  
54 - * @default 确定  
55 - */  
56 - 'ok-text'?: string;  
57 - /**  
58 - * 取消按钮文字  
59 - * @default 取消  
60 - */  
61 - 'cancel-text'?: string;  
62 - /**  
63 - * 对话框宽度,单位 px。  
64 - * 对话框的宽度是响应式的,当屏幕尺寸小于 768px 时,宽度会变为自动auto,  
65 - * @default 520  
66 - */  
67 - width?: number | string;  
68 - /**  
69 - * 不显示底部  
70 - * @default false  
71 - */  
72 - 'footer-hide'?: boolean;  
73 - /**  
74 - * 设置浮层样式,调整浮层位置等,该属性设置的是.ivu-modal的样式  
75 - */  
76 - style?: object;  
77 - /**  
78 - * 设置对话框容器.ivu-modal-wrap的类名,可辅助实现垂直居中等自定义效果  
79 - */  
80 - 'class-name'?: string;  
81 - /**  
82 - * 层级  
83 - * @default 1000  
84 - */  
85 - 'z-index'?: number;  
86 - /**  
87 - * 自定义显示动画,第一项是模态框,第二项是背景,  
88 - * @default ['ease', 'fade']  
89 - */  
90 - 'transition-names'?: Array<string>;  
91 - /**  
92 - * 是否将弹层放置于 body 内,默认值true  
93 - * @default true  
94 - */  
95 - transfer?: boolean;  
96 - /**  
97 - * 点击确定的回调  
98 - */  
99 - $emit(eventName: 'on-ok'): this;  
100 - /**  
101 - * 开关变化时触发,返回当前的状态  
102 - */  
103 - $emit(eventName: 'on-cancel'): this;  
104 - /**  
105 - * 开关变化时触发,返回当前的状态  
106 - */  
107 - $emit(eventName: 'on-visible-change', visible: boolean): this;  
108 - /**  
109 - * slot插槽对象  
110 - */  
111 - $slots: {  
112 - /**  
113 - * 对话框主体内容  
114 - */  
115 - '': VNode[];  
116 - /**  
117 - * 自定义页头  
118 - */  
119 - header: VNode[];  
120 - /**  
121 - * 自定义页脚内容  
122 - */  
123 - footer: VNode[];  
124 - /**  
125 - * 自定义右上角关闭内容  
126 - */  
127 - close: VNode[];  
128 - }; 8 + /**
  9 + * 对话框是否显示,可使用 v-model 双向绑定数据。
  10 + * @default false
  11 + */
  12 + value?: boolean;
  13 + /**
  14 + * 对话框标题,如果使用 slot 自定义了页头,则 title 无效
  15 + */
  16 + title?: string;
  17 + /**
  18 + * 是否显示右上角的关闭按钮,关闭后 Esc 按键也将关闭,
  19 + * @default true
  20 + */
  21 + closable?: boolean;
  22 + /**
  23 + * 是否允许点击遮罩层关闭
  24 + * @default true
  25 + */
  26 + "mask-closable"?: boolean;
  27 + /**
  28 + * 点击确定按钮时,确定按钮是否显示 loading 状态,开启则需手动设置visible来关闭对话框,
  29 + * @default false
  30 + */
  31 + loading?: boolean;
  32 + /**
  33 + * 页面是否可以滚动
  34 + * @default false
  35 + */
  36 + scrollable?: boolean;
  37 + /**
  38 + * 是否全屏显示
  39 + * @default false
  40 + */
  41 + fullscreen?: boolean;
  42 + /**
  43 + * 是否可以拖拽移动
  44 + * @default false
  45 + */
  46 + draggable?: boolean;
  47 + /**
  48 + * 是否显示遮罩层,开启 draggable 时,强制不显示
  49 + * @default true
  50 + */
  51 + mask?: boolean;
  52 + /**
  53 + * 确定按钮文字
  54 + * @default 确定
  55 + */
  56 + "ok-text"?: string;
  57 + /**
  58 + * 取消按钮文字
  59 + * @default 取消
  60 + */
  61 + "cancel-text"?: string;
  62 + /**
  63 + * 对话框宽度,单位 px。
  64 + * 对话框的宽度是响应式的,当屏幕尺寸小于 768px 时,宽度会变为自动auto,
  65 + * @default 520
  66 + */
  67 + width?: number | string;
  68 + /**
  69 + * 不显示底部
  70 + * @default false
  71 + */
  72 + "footer-hide"?: boolean;
  73 + /**
  74 + * 设置浮层样式,调整浮层位置等,该属性设置的是.ivu-modal的样式
  75 + */
  76 + style?: object;
  77 + /**
  78 + * 设置对话框容器.ivu-modal-wrap的类名,可辅助实现垂直居中等自定义效果
  79 + */
  80 + "class-name"?: string;
  81 + /**
  82 + * 层级
  83 + * @default 1000
  84 + */
  85 + "z-index"?: number;
  86 + /**
  87 + * 自定义显示动画,第一项是模态框,第二项是背景,
  88 + * @default ['ease', 'fade']
  89 + */
  90 + "transition-names"?: Array<string>;
  91 + /**
  92 + * 是否将弹层放置于 body 内,默认值true
  93 + * @default true
  94 + */
  95 + transfer?: boolean;
  96 + /**
  97 + * 点击确定的回调
  98 + */
  99 + $emit(eventName: "on-ok"): this;
  100 + /**
  101 + * 开关变化时触发,返回当前的状态
  102 + */
  103 + $emit(eventName: "on-cancel"): this;
  104 + /**
  105 + * 开关变化时触发,返回当前的状态
  106 + */
  107 + $emit(eventName: "on-visible-change", visible: boolean): this;
  108 + /**
  109 + * slot插槽对象
  110 + */
  111 + $slots: {
  112 + /**
  113 + * 对话框主体内容
  114 + */
  115 + "": VNode[];
  116 + /**
  117 + * 自定义页头
  118 + */
  119 + header: VNode[];
  120 + /**
  121 + * 自定义页脚内容
  122 + */
  123 + footer: VNode[];
  124 + /**
  125 + * 自定义右上角关闭内容
  126 + */
  127 + close: VNode[];
  128 + };
129 } 129 }
130 130
131 export declare interface ModalInstance { 131 export declare interface ModalInstance {
132 - /**  
133 - * 消息  
134 - * @param config ModalConfig为相关配置,string为待显示的内容  
135 - */  
136 - info(config?: ModalConfig | string): void;  
137 - /**  
138 - * 成功  
139 - * @param config ModalConfig为相关配置,string为待显示的内容  
140 - */  
141 - success(config?: ModalConfig | string): void;  
142 - /**  
143 - * 警告  
144 - * @param config ModalConfig为相关配置,string为待显示的内容  
145 - */  
146 - warning(config?: ModalConfig | string): void;  
147 - /**  
148 - * 错误  
149 - * @param config ModalConfig为相关配置,string为待显示的内容  
150 - */  
151 - error(config?: ModalConfig | string): void;  
152 - /**  
153 - * 对话框  
154 - * @param config ModalConfig为相关配置,string为待显示的内容  
155 - */  
156 - confirm(config?: ModalConfig | string): void;  
157 - /**  
158 - * 移除  
159 - */  
160 - remove(): void; 132 + /**
  133 + * 消息
  134 + * @param config ModalConfig为相关配置,string为待显示的内容
  135 + */
  136 + info(config?: ModalConfig | string): void;
  137 + /**
  138 + * 成功
  139 + * @param config ModalConfig为相关配置,string为待显示的内容
  140 + */
  141 + success(config?: ModalConfig | string): void;
  142 + /**
  143 + * 警告
  144 + * @param config ModalConfig为相关配置,string为待显示的内容
  145 + */
  146 + warning(config?: ModalConfig | string): void;
  147 + /**
  148 + * 错误
  149 + * @param config ModalConfig为相关配置,string为待显示的内容
  150 + */
  151 + error(config?: ModalConfig | string): void;
  152 + /**
  153 + * 对话框
  154 + * @param config ModalConfig为相关配置,string为待显示的内容
  155 + */
  156 + confirm(config?: ModalConfig | string): void;
  157 + /**
  158 + * 移除
  159 + */
  160 + remove(): void;
161 } 161 }
162 162
163 export declare interface ModalConfig { 163 export declare interface ModalConfig {
164 - /**  
165 - * 标题或者Element选择器字符串  
166 - */  
167 - title?: string;  
168 - /**  
169 - * 内容或者Element选择器字符串  
170 - */  
171 - content?: string;  
172 - /**  
173 - * 自定义内容,使用后不再限制类型, content 也无效。  
174 - */  
175 - render?: (h?) => void;  
176 - /**  
177 - * 宽度,单位 px  
178 - * @default 416  
179 - */  
180 - width?: number | string;  
181 - /**  
182 - * 确定按钮的文字  
183 - * @default 确定  
184 - */  
185 - okText?: string;  
186 - /**  
187 - * 取消按钮的文字,只在Modal.confirm()下有效  
188 - * @default 取消  
189 - */  
190 - cancelText?: string;  
191 - /**  
192 - * 点击确定按钮时,确定按钮是否显示 loading 状态,开启则需手动调用Modal.remove()来关闭对话框  
193 - * @default false  
194 - */  
195 - loading?: boolean;  
196 - /**  
197 - * 页面是否可以滚动  
198 - * @default false  
199 - */  
200 - scrollable?: boolean;  
201 - /**  
202 - * 页面是否可以滚动  
203 - * @default false  
204 - */  
205 - closable?: boolean;  
206 - /**  
207 - * 点击确定的回调  
208 - */  
209 - onOk?: () => void;  
210 - /**  
211 - * 点击取消的回调,只在Modal.confirm()下有效  
212 - */  
213 - onCancel?: () => void;  
214 -}  
215 -  
216 -declare module 'vue/types/vue' {  
217 - interface Vue {  
218 /** 164 /**
219 - * 对话框 165 + * 标题或者Element选择器字符串
  166 + */
  167 + title?: string;
  168 + /**
  169 + * 内容或者Element选择器字符串
220 */ 170 */
221 - $Modal: ModalInstance;  
222 - } 171 + content?: string;
  172 + /**
  173 + * 自定义内容,使用后不再限制类型, content 也无效。
  174 + * @param h Render函数
  175 + */
  176 + render?: (h?: CreateElement) => void;
  177 + /**
  178 + * 宽度,单位 px
  179 + * @default 416
  180 + */
  181 + width?: number | string;
  182 + /**
  183 + * 确定按钮的文字
  184 + * @default 确定
  185 + */
  186 + okText?: string;
  187 + /**
  188 + * 取消按钮的文字,只在Modal.confirm()下有效
  189 + * @default 取消
  190 + */
  191 + cancelText?: string;
  192 + /**
  193 + * 点击确定按钮时,确定按钮是否显示 loading 状态,开启则需手动调用Modal.remove()来关闭对话框
  194 + * @default false
  195 + */
  196 + loading?: boolean;
  197 + /**
  198 + * 页面是否可以滚动
  199 + * @default false
  200 + */
  201 + scrollable?: boolean;
  202 + /**
  203 + * 页面是否可以滚动
  204 + * @default false
  205 + */
  206 + closable?: boolean;
  207 + /**
  208 + * 点击确定的回调
  209 + */
  210 + onOk?: () => void;
  211 + /**
  212 + * 点击取消的回调,只在Modal.confirm()下有效
  213 + */
  214 + onCancel?: () => void;
  215 +}
  216 +
  217 +declare module "vue/types/vue" {
  218 + interface Vue {
  219 + /**
  220 + * 对话框
  221 + */
  222 + $Modal: ModalInstance;
  223 + }
223 } 224 }
@@ -5,88 +5,89 @@ @@ -5,88 +5,89 @@
5 import Vue, { VNode, CreateElement } from "vue"; 5 import Vue, { VNode, CreateElement } from "vue";
6 6
7 export declare interface Notice { 7 export declare interface Notice {
8 - /**  
9 - * 打开  
10 - * @param config NoticeConfig为相关配置,string为待显示的内容  
11 - */  
12 - open(config?: NoticeConfig | string): void;  
13 - /**  
14 - * 信息  
15 - * @param config NoticeConfig为相关配置,string为待显示的内容  
16 - */  
17 - info(config?: NoticeConfig | string): void;  
18 - /**  
19 - * 成功  
20 - * @param config NoticeConfig为相关配置,string为待显示的内容  
21 - */  
22 - success(config?: NoticeConfig | string): void;  
23 - /**  
24 - * 警告  
25 - * @param config NoticeConfig为相关配置,string为待显示的内容  
26 - */  
27 - warning(config?: NoticeConfig | string): void;  
28 - /**  
29 - * 错误  
30 - * @param config NoticeConfig为相关配置,string为待显示的内容  
31 - */  
32 - error(config?: NoticeConfig): void;  
33 - /**  
34 - * 全局配置  
35 - */  
36 - config(options?: NoticeGlobalConfig): void;  
37 - /**  
38 - * 全局关闭某个通知  
39 - */  
40 - close(name?: string): void;  
41 - /**  
42 - * 全局销毁  
43 - */  
44 - destroy(): void; 8 + /**
  9 + * 打开
  10 + * @param config NoticeConfig为相关配置,string为待显示的内容
  11 + */
  12 + open(config?: NoticeConfig | string): void;
  13 + /**
  14 + * 信息
  15 + * @param config NoticeConfig为相关配置,string为待显示的内容
  16 + */
  17 + info(config?: NoticeConfig | string): void;
  18 + /**
  19 + * 成功
  20 + * @param config NoticeConfig为相关配置,string为待显示的内容
  21 + */
  22 + success(config?: NoticeConfig | string): void;
  23 + /**
  24 + * 警告
  25 + * @param config NoticeConfig为相关配置,string为待显示的内容
  26 + */
  27 + warning(config?: NoticeConfig | string): void;
  28 + /**
  29 + * 错误
  30 + * @param config NoticeConfig为相关配置,string为待显示的内容
  31 + */
  32 + error(config?: NoticeConfig): void;
  33 + /**
  34 + * 全局配置
  35 + */
  36 + config(options?: NoticeGlobalConfig): void;
  37 + /**
  38 + * 全局关闭某个通知
  39 + */
  40 + close(name?: string): void;
  41 + /**
  42 + * 全局销毁
  43 + */
  44 + destroy(): void;
45 } 45 }
46 46
47 export declare interface NoticeConfig { 47 export declare interface NoticeConfig {
48 - /**  
49 - * 通知提醒的标题  
50 - */  
51 - title?: string;  
52 - /**  
53 - * 通知提醒的内容,为空或不填时,自动应用仅标题模式下的样式  
54 - */  
55 - desc?: string;  
56 - /**  
57 - * 自定义描述内容,使用 Vue 的 Render 函数  
58 - */  
59 - render?: (h: CreateElement) => VNode;  
60 - /**  
61 - * 自动关闭的延时,单位秒,不关闭可以写 0 默认4.5  
62 - */  
63 - duration?: number;  
64 - /**  
65 - * 当前通知的唯一标识  
66 - */  
67 - name?: string;  
68 - /**  
69 - * 关闭时的回调  
70 - */  
71 - onClose?: Function; 48 + /**
  49 + * 通知提醒的标题
  50 + */
  51 + title?: string;
  52 + /**
  53 + * 通知提醒的内容,为空或不填时,自动应用仅标题模式下的样式
  54 + */
  55 + desc?: string;
  56 + /**
  57 + * 自定义描述内容,使用 Vue 的 Render 函数
  58 + * @param h Render函数
  59 + */
  60 + render?: (h?: CreateElement) => VNode;
  61 + /**
  62 + * 自动关闭的延时,单位秒,不关闭可以写 0 默认4.5
  63 + */
  64 + duration?: number;
  65 + /**
  66 + * 当前通知的唯一标识
  67 + */
  68 + name?: string;
  69 + /**
  70 + * 关闭时的回调
  71 + */
  72 + onClose?: Function;
72 } 73 }
73 74
74 export declare interface NoticeGlobalConfig { 75 export declare interface NoticeGlobalConfig {
75 - /**  
76 - * 通知组件距离顶端的距离,单位像素 默认24  
77 - */  
78 - top?: number;  
79 - /**  
80 - * 默认自动关闭的延时,单位秒 默认4.5  
81 - */  
82 - duration?: number;  
83 -}  
84 -  
85 -declare module 'vue/types/vue' {  
86 - interface Vue {  
87 /** 76 /**
88 - * 通知提醒 77 + * 通知组件距离顶端的距离,单位像素 默认24
  78 + */
  79 + top?: number;
  80 + /**
  81 + * 默认自动关闭的延时,单位秒 默认4.5
89 */ 82 */
90 - $Notice: Notice;  
91 - }  
92 -}  
93 \ No newline at end of file 83 \ No newline at end of file
  84 + duration?: number;
  85 +}
  86 +
  87 +declare module "vue/types/vue" {
  88 + interface Vue {
  89 + /**
  90 + * 通知提醒
  91 + */
  92 + $Notice: Notice;
  93 + }
  94 +}
@@ -2,418 +2,427 @@ @@ -2,418 +2,427 @@
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
5 -import Vue, { VNode } from 'vue'; 5 +import Vue, { VNode, CreateElement } from "vue";
6 6
7 export declare interface Table extends Vue { 7 export declare interface Table extends Vue {
8 - /**  
9 - * 显示的结构化数据,其中,字段 cellClassName 用于设置任意单元格的样式名称,  
10 - * 因此数据不能使用该字段,详见示例特定样式。  
11 - * @default []  
12 - */  
13 - data?: object[];  
14 - /**  
15 - * 表格列的配置描述,具体项见后文  
16 - * @default []  
17 - */  
18 - columns?: object[];  
19 - /**  
20 - * 是否显示间隔斑马纹  
21 - * @default false  
22 - */  
23 - stripe?: boolean;  
24 - /**  
25 - * 是否显示纵向边框  
26 - * @default false  
27 - */  
28 - border?: boolean;  
29 - /**  
30 - * 是否显示表头  
31 - * @default true  
32 - */  
33 - 'show-header'?: boolean;  
34 - /**  
35 - * 表格宽度,单位 px  
36 - * @default 自动  
37 - */  
38 - width?: number | string;  
39 - /**  
40 - * 表格高度,单位 px,设置后,如果表格内容大于此值,会固定表头  
41 - */  
42 - height?: number | string;  
43 - /**  
44 - * 表格是否加载中  
45 - * @default false  
46 - */  
47 - loading?: boolean;  
48 - /**  
49 - * 禁用鼠标悬停时的高亮  
50 - * @default false  
51 - */  
52 - 'disabled-hover'?: boolean;  
53 - /**  
54 - * 是否支持高亮选中的行,即单选  
55 - * @default false  
56 - */  
57 - 'highlight-row'?: boolean;  
58 - /**  
59 - * 行的 className 的回调方法,传入参数:  
60 - * row:当前行数据  
61 - * index:当前行的索引  
62 - */  
63 - 'row-class-name'?: (row?: object, index?: number) => void;  
64 - /**  
65 - * 表格尺寸,可选值为 large、small、default 或者不填  
66 - */  
67 - size?: string;  
68 - /**  
69 - * 数据为空时显示的提示内容  
70 - * @default 暂无数据  
71 - */  
72 - 'no-data-text'?: string;  
73 - /**  
74 - * 筛选数据为空时显示的提示内容  
75 - * @default 暂无筛选结果  
76 - */  
77 - 'no-filtered-data-text'?: string;  
78 - /**  
79 - * 开启 highlight-row 后有效,当表格的当前行发生变化的时候会触发  
80 - * currentRow:当前高亮行的数据  
81 - * oldCurrentRow:上一次高亮的数据  
82 - */  
83 - $emit(eventName: 'on-current-change', currentRow: object, oldCurrentRow: object): this;  
84 - /**  
85 - * 在多选模式下有效,选中某一项时触发  
86 - * selection:已选项数据  
87 - * row:刚选择的项数据  
88 - */  
89 - $emit(eventName: 'on-select', selection: object[], row: object): this;  
90 - /**  
91 - * 在多选模式下有效,取消选中某一项时触发  
92 - * selection:已选项数据  
93 - * row:取消选择的项数据  
94 - */  
95 - $emit(eventName: 'on-select-cancel', selection: object[], row: object): this;  
96 - /**  
97 - * 在多选模式下有效,点击全选时触发  
98 - * selection:已选项数据  
99 - */  
100 - $emit(eventName: 'on-select-all', selection: object[]): this;  
101 - /**  
102 - * 在多选模式下有效,只要选中项发生变化时就会触发  
103 - * selection:已选项数据  
104 - */  
105 - $emit(eventName: 'on-selection-change', selection: object[]): this;  
106 - /**  
107 - * 排序时有效,当点击排序时触发  
108 - * column:当前列数据  
109 - * key:排序依据的指标  
110 - * order:排序的顺序,值为 asc 或 desc  
111 - */  
112 - $emit(eventName: 'on-sort-change', column?: object, key?: string, order?: 'asc' | 'desc'): this;  
113 - /**  
114 - * 筛选时有效,筛选条件发生变化时触发 当前列数据  
115 - */  
116 - $emit(eventName: 'on-filter-change', value: any): this;  
117 - /**  
118 - * 单击某一行时触发  
119 - * currentRow:当前行的数据  
120 - * index?: 当前行的索引  
121 - */  
122 - $emit(eventName: 'on-row-click', currentRow: object, index: number): this;  
123 - /**  
124 - * 双击某一行时触发  
125 - * currentRow:当前行的数据  
126 - * index?: 当前行的索引  
127 - */  
128 - $emit(eventName: 'on-row-dblclick', currentRow: object, index: number): this;  
129 - /**  
130 - * 展开或收起某一行时触发  
131 - * row:当前行的数据  
132 - * status:当前的状态  
133 - */  
134 - $emit(eventName: 'on-expand', row: object, status: string): this;  
135 - /**  
136 - * 导出数据  
137 - */  
138 - exportCsv(params: TableExportCsvParams): void;  
139 - /**  
140 - * 执行改变大小重绘table  
141 - */  
142 - handleResize(): void;  
143 - /**  
144 - * 清除高亮项,仅在开启 highlight-row 时可用  
145 - */  
146 - clearCurrentRow(): void;  
147 - /**  
148 - * slot插槽对象  
149 - */  
150 - $slots: {  
151 - /**  
152 - * 表头  
153 - */  
154 - header: VNode[];  
155 - /**  
156 - * 页脚  
157 - */  
158 - footer: VNode[];  
159 - /**  
160 - * 加载中  
161 - */  
162 - loading: VNode[];  
163 - }; 8 + /**
  9 + * 显示的结构化数据,其中,字段 cellClassName 用于设置任意单元格的样式名称,
  10 + * 因此数据不能使用该字段,详见示例特定样式。
  11 + * @default []
  12 + */
  13 + data?: object[];
  14 + /**
  15 + * 表格列的配置描述,具体项见后文
  16 + * @default []
  17 + */
  18 + columns?: object[];
  19 + /**
  20 + * 是否显示间隔斑马纹
  21 + * @default false
  22 + */
  23 + stripe?: boolean;
  24 + /**
  25 + * 是否显示纵向边框
  26 + * @default false
  27 + */
  28 + border?: boolean;
  29 + /**
  30 + * 是否显示表头
  31 + * @default true
  32 + */
  33 + "show-header"?: boolean;
  34 + /**
  35 + * 表格宽度,单位 px
  36 + * @default 自动
  37 + */
  38 + width?: number | string;
  39 + /**
  40 + * 表格高度,单位 px,设置后,如果表格内容大于此值,会固定表头
  41 + */
  42 + height?: number | string;
  43 + /**
  44 + * 表格是否加载中
  45 + * @default false
  46 + */
  47 + loading?: boolean;
  48 + /**
  49 + * 禁用鼠标悬停时的高亮
  50 + * @default false
  51 + */
  52 + "disabled-hover"?: boolean;
  53 + /**
  54 + * 是否支持高亮选中的行,即单选
  55 + * @default false
  56 + */
  57 + "highlight-row"?: boolean;
  58 + /**
  59 + * 行的 className 的回调方法,传入参数:
  60 + * row:当前行数据
  61 + * index:当前行的索引
  62 + */
  63 + "row-class-name"?: (row?: object, index?: number) => void;
  64 + /**
  65 + * 表格尺寸,可选值为 large、small、default 或者不填
  66 + */
  67 + size?: string;
  68 + /**
  69 + * 数据为空时显示的提示内容
  70 + * @default 暂无数据
  71 + */
  72 + "no-data-text"?: string;
  73 + /**
  74 + * 筛选数据为空时显示的提示内容
  75 + * @default 暂无筛选结果
  76 + */
  77 + "no-filtered-data-text"?: string;
  78 + /**
  79 + * 开启 highlight-row 后有效,当表格的当前行发生变化的时候会触发
  80 + * currentRow:当前高亮行的数据
  81 + * oldCurrentRow:上一次高亮的数据
  82 + */
  83 + $emit(
  84 + eventName: "on-current-change",
  85 + currentRow: object,
  86 + oldCurrentRow: object
  87 + ): this;
  88 + /**
  89 + * 在多选模式下有效,选中某一项时触发
  90 + * selection:已选项数据
  91 + * row:刚选择的项数据
  92 + */
  93 + $emit(eventName: "on-select", selection: object[], row: object): this;
  94 + /**
  95 + * 在多选模式下有效,取消选中某一项时触发
  96 + * selection:已选项数据
  97 + * row:取消选择的项数据
  98 + */
  99 + $emit(
  100 + eventName: "on-select-cancel",
  101 + selection: object[],
  102 + row: object
  103 + ): this;
  104 + /**
  105 + * 在多选模式下有效,点击全选时触发
  106 + * selection:已选项数据
  107 + */
  108 + $emit(eventName: "on-select-all", selection: object[]): this;
  109 + /**
  110 + * 在多选模式下有效,只要选中项发生变化时就会触发
  111 + * selection:已选项数据
  112 + */
  113 + $emit(eventName: "on-selection-change", selection: object[]): this;
  114 + /**
  115 + * 排序时有效,当点击排序时触发
  116 + * column:当前列数据
  117 + * key:排序依据的指标
  118 + * order:排序的顺序,值为 asc 或 desc
  119 + */
  120 + $emit(
  121 + eventName: "on-sort-change",
  122 + column?: object,
  123 + key?: string,
  124 + order?: "asc" | "desc"
  125 + ): this;
  126 + /**
  127 + * 筛选时有效,筛选条件发生变化时触发 当前列数据
  128 + */
  129 + $emit(eventName: "on-filter-change", value: any): this;
  130 + /**
  131 + * 单击某一行时触发
  132 + * currentRow:当前行的数据
  133 + * index?: 当前行的索引
  134 + */
  135 + $emit(eventName: "on-row-click", currentRow: object, index: number): this;
  136 + /**
  137 + * 双击某一行时触发
  138 + * currentRow:当前行的数据
  139 + * index?: 当前行的索引
  140 + */
  141 + $emit(
  142 + eventName: "on-row-dblclick",
  143 + currentRow: object,
  144 + index: number
  145 + ): this;
  146 + /**
  147 + * 展开或收起某一行时触发
  148 + * row:当前行的数据
  149 + * status:当前的状态
  150 + */
  151 + $emit(eventName: "on-expand", row: object, status: string): this;
  152 + /**
  153 + * 导出数据
  154 + */
  155 + exportCsv(params: TableExportCsvParams): void;
  156 + /**
  157 + * 执行改变大小重绘table
  158 + */
  159 + handleResize(): void;
  160 + /**
  161 + * 清除高亮项,仅在开启 highlight-row 时可用
  162 + */
  163 + clearCurrentRow(): void;
  164 + /**
  165 + * slot插槽对象
  166 + */
  167 + $slots: {
  168 + /**
  169 + * 表头
  170 + */
  171 + header: VNode[];
  172 + /**
  173 + * 页脚
  174 + */
  175 + footer: VNode[];
  176 + /**
  177 + * 加载中
  178 + */
  179 + loading: VNode[];
  180 + };
164 } 181 }
165 182
166 export declare interface TableColumn { 183 export declare interface TableColumn {
167 - /**  
168 - * 列类型,可选值为 index、selection、expand、html  
169 - */  
170 - type?: 'index' | 'selection' | 'expand' | 'html';  
171 - /**  
172 - * 列头显示文字  
173 - * @default #  
174 - */  
175 - title?: string;  
176 - /**  
177 - * 对应列内容的字段名  
178 - */  
179 - key?: string;  
180 - /**  
181 - * 列宽  
182 - */  
183 - width?: number;  
184 - /**  
185 - * 最小列宽  
186 - */  
187 - minWidth?: number;  
188 - /**  
189 - * 最大列宽  
190 - */  
191 - maxWidth?: number;  
192 - /**  
193 - * 对齐方式,可选值为 left 左对齐、right 右对齐和 center 居中对齐,默认 left  
194 - * @default left  
195 - */  
196 - align?: 'left' | 'right' | 'center';  
197 - /**  
198 - * 列的样式名称  
199 - */  
200 - className?: string;  
201 - /**  
202 - * 列是否固定在左侧或者右侧,可选值为 left 左侧和 right 右侧  
203 - */  
204 - fixed?: 'left' | 'right';  
205 - /**  
206 - * 开启后,文本将不换行,超出部分显示为省略号  
207 - * @default false  
208 - */  
209 - ellipsis?: boolean;  
210 - /**  
211 - * 开启后,文本将不换行,超出部分显示为省略号,并用 Tooltip 组件显示完整内容  
212 - * @default false  
213 - */  
214 - tooltip?: boolean;  
215 - /**  
216 - * 自定义渲染列,使用 Vue 的 Render 函数。  
217 - * 传入两个参数,第一个是 h,第二个为对象,包含 row、column 和 index,  
218 - * 分别指当前行数据,当前列数据,当前行索引,详见示例。  
219 - * 学习 Render 函数的内容 从 rc.18 版本开始,我们将不再支持旧的用法。旧的 render 函数已被废弃。  
220 - */  
221 - render?: (h?:  
222 - (  
223 - el?: string | object | Function,  
224 - data?: string | TableRenderCreateElementData | TableRenderCreateElementResult | Array<TableRenderCreateElementResult>,  
225 - vnode?: string | TableRenderCreateElementResult[]  
226 - ) => TableRenderCreateElementResult,  
227 - params?: TableColumnRenderParams  
228 - ) => TableRenderCreateElementResult;  
229 - /**  
230 - * 自定义列头显示内容,传入参数有两个,column 和 index,分别为当前列数据和当前列索引,不支持渲染自定义组件  
231 - */  
232 - renderHeader?: (h?:  
233 - (  
234 - el?: string | object | Function,  
235 - data?: string | TableRenderCreateElementData | TableRenderCreateElementResult | Array<TableRenderCreateElementResult>,  
236 - vnode?: string | TableRenderCreateElementResult[]  
237 - ) => TableRenderCreateElementResult,  
238 - params?: TableColumnRenderHeadParams  
239 - ) => TableRenderCreateElementResult;  
240 - /**  
241 - * 对应列是否可以排序,如果设置为 custom,则代表用户希望远程排序,  
242 - * 需要监听 Table 的 on- sort - change 事件,默认false  
243 - * @default false  
244 - */  
245 - sortable?: boolean | 'custom';  
246 - /**  
247 - * 自定义排序使用的方法,接收三个参数 a 、 b 和 type,  
248 - * 当设置 sortable?: true 时有效。type 值为 asc 和 desc  
249 - */  
250 - sortMethod?: (a: any, b: any, type: 'asc' | 'desc') => void;  
251 - /**  
252 - * 设置初始化排序。值为 asc 和 desc  
253 - */  
254 - sortType?: 'asc' | 'desc';  
255 - /**  
256 - * 过滤数据的选项,格式为数组,数组中每项包含 label 和 value 属性,使用过滤,必须同时配置filterMethod  
257 - */  
258 - filters?: { label: string, value: string | number | boolean }[];  
259 - /**  
260 - * 数据过滤使用的方法,如果是多选的筛选项,对每一条数据会执行多次,任意一次返回 true 就会显示  
261 - */  
262 - filterMethod?: () => void;  
263 - /**  
264 - * 数据过滤的选项是否多选  
265 - * @default true  
266 - */  
267 - filterMultiple?: boolean;  
268 - /**  
269 - * 在初始化时使用过滤,数组,值为需要过滤的 value 集合  
270 - */  
271 - filteredValue?: (string | number | boolean)[];  
272 - /**  
273 - * 使用远程过滤  
274 - */  
275 - filterRemote?: () => void;  
276 - /**  
277 - * 表头分组  
278 - */  
279 - children?: object[]; 184 + /**
  185 + * 列类型,可选值为 index、selection、expand、html
  186 + */
  187 + type?: "index" | "selection" | "expand" | "html";
  188 + /**
  189 + * 列头显示文字
  190 + * @default #
  191 + */
  192 + title?: string;
  193 + /**
  194 + * 对应列内容的字段名
  195 + */
  196 + key?: string;
  197 + /**
  198 + * 列宽
  199 + */
  200 + width?: number;
  201 + /**
  202 + * 最小列宽
  203 + */
  204 + minWidth?: number;
  205 + /**
  206 + * 最大列宽
  207 + */
  208 + maxWidth?: number;
  209 + /**
  210 + * 对齐方式,可选值为 left 左对齐、right 右对齐和 center 居中对齐,默认 left
  211 + * @default left
  212 + */
  213 + align?: "left" | "right" | "center";
  214 + /**
  215 + * 列的样式名称
  216 + */
  217 + className?: string;
  218 + /**
  219 + * 列是否固定在左侧或者右侧,可选值为 left 左侧和 right 右侧
  220 + */
  221 + fixed?: "left" | "right";
  222 + /**
  223 + * 开启后,文本将不换行,超出部分显示为省略号
  224 + * @default false
  225 + */
  226 + ellipsis?: boolean;
  227 + /**
  228 + * 开启后,文本将不换行,超出部分显示为省略号,并用 Tooltip 组件显示完整内容
  229 + * @default false
  230 + */
  231 + tooltip?: boolean;
  232 + /**
  233 + * 自定义渲染列,使用 Vue 的 Render 函数。
  234 + * 传入两个参数,第一个是 h,第二个为对象,包含 row、column 和 index,
  235 + * 分别指当前行数据,当前列数据,当前行索引,详见示例。
  236 + * 学习 Render 函数的内容 从 rc.18 版本开始,我们将不再支持旧的用法。旧的 render 函数已被废弃。
  237 + * @param h Render函数
  238 + * @param params 对象,包含 row、column 和 index
  239 + */
  240 + render?: (
  241 + h?: CreateElement,
  242 + params?: TableColumnRenderParams
  243 + ) => TableRenderCreateElementResult;
  244 + /**
  245 + * 自定义列头显示内容,传入参数有两个,column 和 index,分别为当前列数据和当前列索引,不支持渲染自定义组件
  246 + * @param h Render函数
  247 + * @param params 对象,包含 row、column 和 index
  248 + */
  249 + renderHeader?: (
  250 + h?: CreateElement,
  251 + params?: TableColumnRenderHeadParams
  252 + ) => TableRenderCreateElementResult;
  253 + /**
  254 + * 对应列是否可以排序,如果设置为 custom,则代表用户希望远程排序,
  255 + * 需要监听 Table 的 on- sort - change 事件,默认false
  256 + * @default false
  257 + */
  258 + sortable?: boolean | "custom";
  259 + /**
  260 + * 自定义排序使用的方法,接收三个参数 a 、 b 和 type,
  261 + * 当设置 sortable?: true 时有效。type 值为 asc 和 desc
  262 + */
  263 + sortMethod?: (a: any, b: any, type: "asc" | "desc") => void;
  264 + /**
  265 + * 设置初始化排序。值为 asc 和 desc
  266 + */
  267 + sortType?: "asc" | "desc";
  268 + /**
  269 + * 过滤数据的选项,格式为数组,数组中每项包含 label 和 value 属性,使用过滤,必须同时配置filterMethod
  270 + */
  271 + filters?: { label: string; value: string | number | boolean }[];
  272 + /**
  273 + * 数据过滤使用的方法,如果是多选的筛选项,对每一条数据会执行多次,任意一次返回 true 就会显示
  274 + */
  275 + filterMethod?: () => void;
  276 + /**
  277 + * 数据过滤的选项是否多选
  278 + * @default true
  279 + */
  280 + filterMultiple?: boolean;
  281 + /**
  282 + * 在初始化时使用过滤,数组,值为需要过滤的 value 集合
  283 + */
  284 + filteredValue?: (string | number | boolean)[];
  285 + /**
  286 + * 使用远程过滤
  287 + */
  288 + filterRemote?: () => void;
  289 + /**
  290 + * 表头分组
  291 + */
  292 + children?: object[];
280 } 293 }
281 294
282 export declare interface TableRenderCreateElementData { 295 export declare interface TableRenderCreateElementData {
283 - /**  
284 - * 和`v-bind:class`一样的 API  
285 - */  
286 - 'class'?: object;  
287 - /**  
288 - * 和`v-bind:style`一样的 API  
289 - */  
290 - style?: object;  
291 - /**  
292 - * 正常的 HTML 特性  
293 - */  
294 - attrs?: object,  
295 - /**  
296 - * 组件 props  
297 - */  
298 - props?: object;  
299 - /**  
300 - * DOM 属性  
301 - */  
302 - domProps?: object;  
303 - /**  
304 - * 事件监听器基于 "on"  
305 - * 所以不再支持如 v-on?:keyup.enter 修饰器  
306 - * 需要手动匹配 keyCode。  
307 - */  
308 - on?: object;  
309 - /**  
310 - * 仅对于组件,用于监听原生事件,而不是组件使用 vm.$emit 触发的事件。  
311 - */  
312 - nativeOn?: object;  
313 - /**  
314 - * 自定义指令. 注意事项:不能对绑定的旧值设值  
315 - * Vue 会为您持续追踨  
316 - */  
317 - directives?: object[];  
318 - /**  
319 - * 如果子组件有定义 slot 的名称  
320 - */  
321 - slot?: string;  
322 - /**  
323 - * 其他特殊顶层属性,myKey  
324 - */  
325 - key?: string;  
326 - /**  
327 - * myRef  
328 - */  
329 - ref?: string 296 + /**
  297 + * 和`v-bind:class`一样的 API
  298 + */
  299 + class?: object;
  300 + /**
  301 + * 和`v-bind:style`一样的 API
  302 + */
  303 + style?: object;
  304 + /**
  305 + * 正常的 HTML 特性
  306 + */
  307 + attrs?: object;
  308 + /**
  309 + * 组件 props
  310 + */
  311 + props?: object;
  312 + /**
  313 + * DOM 属性
  314 + */
  315 + domProps?: object;
  316 + /**
  317 + * 事件监听器基于 "on"
  318 + * 所以不再支持如 v-on?:keyup.enter 修饰器
  319 + * 需要手动匹配 keyCode。
  320 + */
  321 + on?: object;
  322 + /**
  323 + * 仅对于组件,用于监听原生事件,而不是组件使用 vm.$emit 触发的事件。
  324 + */
  325 + nativeOn?: object;
  326 + /**
  327 + * 自定义指令. 注意事项:不能对绑定的旧值设值
  328 + * Vue 会为您持续追踨
  329 + */
  330 + directives?: object[];
  331 + /**
  332 + * 如果子组件有定义 slot 的名称
  333 + */
  334 + slot?: string;
  335 + /**
  336 + * 其他特殊顶层属性,myKey
  337 + */
  338 + key?: string;
  339 + /**
  340 + * myRef
  341 + */
  342 + ref?: string;
330 } 343 }
331 344
332 export declare interface TableColumnRenderParams { 345 export declare interface TableColumnRenderParams {
333 - /**  
334 - * 当前行数据  
335 - */  
336 - row?: object;  
337 - /**  
338 - * 当前列数据  
339 - */  
340 - column?: object;  
341 - /**  
342 - * 当前行索引  
343 - */  
344 - index?: number; 346 + /**
  347 + * 当前行数据
  348 + */
  349 + row?: object;
  350 + /**
  351 + * 当前列数据
  352 + */
  353 + column?: object;
  354 + /**
  355 + * 当前行索引
  356 + */
  357 + index?: number;
345 } 358 }
346 359
347 export declare interface TableRenderCreateElementResult { 360 export declare interface TableRenderCreateElementResult {
348 - child?: object;  
349 - children?: Array<any>;  
350 - componentInstance?: object;  
351 - componentOptions?: object;  
352 - context?: object;  
353 - data?: object;  
354 - elm?: object;  
355 - functionalContext?: object;  
356 - isCloned?: boolean;  
357 - isComment?: boolean;  
358 - isOnce?: boolean;  
359 - isRootInsert?: boolean;  
360 - isStatic?: boolean;  
361 - key?: object;  
362 - ns?: object;  
363 - parent?: object;  
364 - raw?: boolean;  
365 - tag?: string;  
366 - text?: object; 361 + child?: object;
  362 + children?: Array<any>;
  363 + componentInstance?: object;
  364 + componentOptions?: object;
  365 + context?: object;
  366 + data?: object;
  367 + elm?: object;
  368 + functionalContext?: object;
  369 + isCloned?: boolean;
  370 + isComment?: boolean;
  371 + isOnce?: boolean;
  372 + isRootInsert?: boolean;
  373 + isStatic?: boolean;
  374 + key?: object;
  375 + ns?: object;
  376 + parent?: object;
  377 + raw?: boolean;
  378 + tag?: string;
  379 + text?: object;
367 } 380 }
368 381
369 export declare interface TableColumnRenderHeadParams { 382 export declare interface TableColumnRenderHeadParams {
370 - /**  
371 - * 当前列数据  
372 - */  
373 - column?: object;  
374 - /**  
375 - * 当前行索引  
376 - */  
377 - index?: number; 383 + /**
  384 + * 当前列数据
  385 + */
  386 + column?: object;
  387 + /**
  388 + * 当前行索引
  389 + */
  390 + index?: number;
378 } 391 }
379 392
380 export declare interface TableExportCsvParams { 393 export declare interface TableExportCsvParams {
381 - /**  
382 - * 文件名,默认为 table.csv  
383 - */  
384 - filename?: string;  
385 - /**  
386 - * 是否导出为原始数据,默认为 true  
387 - */  
388 - original?: boolean;  
389 - /**  
390 - * 不显示表头,默认为 false  
391 - */  
392 - noHeader?: boolean;  
393 - /**  
394 - * 自定义导出的列数据  
395 - */  
396 - columns?: any[];  
397 - /**  
398 - * 自定义导出的行数据  
399 - */  
400 - data?: any[];  
401 - /**  
402 - * 添加此函数后,不会下载,而是返回数据  
403 - */  
404 - callback?: () => void;  
405 - /**  
406 - * 数据分隔符,默认是逗号(,)  
407 - * @default ,  
408 - */  
409 - separator?: string;  
410 - /**  
411 - * 每项数据是否加引号  
412 - * @default false  
413 - */  
414 - quoted?: boolean; 394 + /**
  395 + * 文件名,默认为 table.csv
  396 + */
  397 + filename?: string;
  398 + /**
  399 + * 是否导出为原始数据,默认为 true
  400 + */
  401 + original?: boolean;
  402 + /**
  403 + * 不显示表头,默认为 false
  404 + */
  405 + noHeader?: boolean;
  406 + /**
  407 + * 自定义导出的列数据
  408 + */
  409 + columns?: any[];
  410 + /**
  411 + * 自定义导出的行数据
  412 + */
  413 + data?: any[];
  414 + /**
  415 + * 添加此函数后,不会下载,而是返回数据
  416 + */
  417 + callback?: () => void;
  418 + /**
  419 + * 数据分隔符,默认是逗号(,)
  420 + * @default ,
  421 + */
  422 + separator?: string;
  423 + /**
  424 + * 每项数据是否加引号
  425 + * @default false
  426 + */
  427 + quoted?: boolean;
415 } 428 }
416 -  
417 -  
418 -  
419 -  
@@ -2,102 +2,103 @@ @@ -2,102 +2,103 @@
2 // Project: https://github.com/iview/iview 2 // Project: https://github.com/iview/iview
3 // Definitions by: yangdan 3 // Definitions by: yangdan
4 // Definitions: https://github.com/yangdan8/iview.git 4 // Definitions: https://github.com/yangdan8/iview.git
5 -import Vue, { VNode } from 'vue'; 5 +import Vue, { VNode, CreateElement } from "vue";
6 6
7 export declare interface Tree extends Vue { 7 export declare interface Tree extends Vue {
8 - /**  
9 - * 可嵌套的节点属性的数组,生成 tree 的数据  
10 - */  
11 - data?: TreeChild[];  
12 - /**  
13 - * 是否支持多选  
14 - * @default false  
15 - */  
16 - multiple?: boolean;  
17 - /**  
18 - * 是否显示多选框  
19 - * @default false  
20 - */  
21 - 'show-checkbox'?: boolean;  
22 - /**  
23 - * 没有数据时的提示  
24 - * @default 暂无数据  
25 - */  
26 - 'empty-text'?: string;  
27 - /**  
28 - * 异步加载数据的方法  
29 - */  
30 - 'load-data'?: () => void;  
31 - /**  
32 - * 自定义渲染内容  
33 - */  
34 - render?: () => void;  
35 - /**  
36 - * 定义子节点键  
37 - * @default children  
38 - */  
39 - 'children-key'?:string;  
40 - /**  
41 - * 点击树节点时触发  
42 - * @default 当前已选中的节点数组  
43 - */  
44 - $emit(eventName: 'on-select-change', value: TreeChild[]): this;  
45 - /**  
46 - * 点击复选框时触发  
47 - * @default 当前已勾选节点的数组  
48 - */  
49 - $emit(eventName: 'on-check-change', value: TreeChild[]): this;  
50 - /**  
51 - * 展开和收起子列表时触发  
52 - * @default 当前节点的数据  
53 - */  
54 - $emit(eventName: 'on-toggle-expand', value: TreeChild): this;  
55 - /**  
56 - * 获取被勾选的节点  
57 - */  
58 - getCheckedNodes(): void;  
59 - /**  
60 - * 获取被选中的节点  
61 - */  
62 - getSelectedNodes(): void; 8 + /**
  9 + * 可嵌套的节点属性的数组,生成 tree 的数据
  10 + */
  11 + data?: TreeChild[];
  12 + /**
  13 + * 是否支持多选
  14 + * @default false
  15 + */
  16 + multiple?: boolean;
  17 + /**
  18 + * 是否显示多选框
  19 + * @default false
  20 + */
  21 + "show-checkbox"?: boolean;
  22 + /**
  23 + * 没有数据时的提示
  24 + * @default 暂无数据
  25 + */
  26 + "empty-text"?: string;
  27 + /**
  28 + * 异步加载数据的方法
  29 + */
  30 + "load-data"?: () => void;
  31 + /**
  32 + * 自定义渲染内容
  33 + * @param h Render函数
  34 + */
  35 + render?: (h?: CreateElement) => void;
  36 + /**
  37 + * 定义子节点键
  38 + * @default children
  39 + */
  40 + "children-key"?: string;
  41 + /**
  42 + * 点击树节点时触发
  43 + * @default 当前已选中的节点数组
  44 + */
  45 + $emit(eventName: "on-select-change", value: TreeChild[]): this;
  46 + /**
  47 + * 点击复选框时触发
  48 + * @default 当前已勾选节点的数组
  49 + */
  50 + $emit(eventName: "on-check-change", value: TreeChild[]): this;
  51 + /**
  52 + * 展开和收起子列表时触发
  53 + * @default 当前节点的数据
  54 + */
  55 + $emit(eventName: "on-toggle-expand", value: TreeChild): this;
  56 + /**
  57 + * 获取被勾选的节点
  58 + */
  59 + getCheckedNodes(): void;
  60 + /**
  61 + * 获取被选中的节点
  62 + */
  63 + getSelectedNodes(): void;
63 } 64 }
64 65
65 export declare interface TreeChild extends Vue { 66 export declare interface TreeChild extends Vue {
66 - /**  
67 - * 标题  
68 - */  
69 - title?: string;  
70 - /**  
71 - * 是否展开直子节点  
72 - * @default false  
73 - */  
74 - expand?: boolean;  
75 - /**  
76 - * 禁掉响应  
77 - * @default false  
78 - */  
79 - disabled?: boolean;  
80 - /**  
81 - * 禁掉checkbox  
82 - * @default false  
83 - */  
84 - disableCheckbox?: boolean;  
85 - /**  
86 - * 是否选中子节点  
87 - * @default false  
88 - */  
89 - selected?: boolean;  
90 - /**  
91 - * 是否勾选(如果勾选,子节点也会全部勾选)  
92 - * @default false  
93 - */  
94 - checked?: boolean;  
95 - /**  
96 - * 子节点属性数组  
97 - */  
98 - children?: TreeChild[];  
99 - /**  
100 - * 自定义当前节点渲染内容,见示例  
101 - */  
102 - render(): void;  
103 -}  
104 \ No newline at end of file 67 \ No newline at end of file
  68 + /**
  69 + * 标题
  70 + */
  71 + title?: string;
  72 + /**
  73 + * 是否展开直子节点
  74 + * @default false
  75 + */
  76 + expand?: boolean;
  77 + /**
  78 + * 禁掉响应
  79 + * @default false
  80 + */
  81 + disabled?: boolean;
  82 + /**
  83 + * 禁掉checkbox
  84 + * @default false
  85 + */
  86 + disableCheckbox?: boolean;
  87 + /**
  88 + * 是否选中子节点
  89 + * @default false
  90 + */
  91 + selected?: boolean;
  92 + /**
  93 + * 是否勾选(如果勾选,子节点也会全部勾选)
  94 + * @default false
  95 + */
  96 + checked?: boolean;
  97 + /**
  98 + * 子节点属性数组
  99 + */
  100 + children?: TreeChild[];
  101 + /**
  102 + * 自定义当前节点渲染内容,见示例
  103 + */
  104 + render(): void;
  105 +}