From ebd6cde2e1011e7949bd1fe97783aa5b2477a952 Mon Sep 17 00:00:00 2001 From: XY <541075770@qq.com> Date: Wed, 10 Apr 2019 10:31:43 +0900 Subject: [PATCH 01/11] add type definition for Form --- types/form/form.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/form/form.d.ts b/types/form/form.d.ts index 59feb60bb..62f7ab9cb 100644 --- a/types/form/form.d.ts +++ b/types/form/form.d.ts @@ -363,6 +363,12 @@ export declare class Form extends AntdComponent { options: object; createForm(context: Vue, options?: IformCreateOption): any; + + /** + * Convert props to field value + * @param field + */ + createFormField(field: any): any; } declare module 'vue/types/vue' { From 219982e927f5bfe547bb88b61e7729acf2caf931 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Wed, 10 Apr 2019 21:58:12 +0800 Subject: [PATCH 02/11] update site --- site/components/geektime.vue | 2 +- site/components/sponsors.vue | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/site/components/geektime.vue b/site/components/geektime.vue index f6bff27c7..d1c9bad74 100644 --- a/site/components/geektime.vue +++ b/site/components/geektime.vue @@ -7,7 +7,7 @@ Vue 实战教程 diff --git a/site/components/sponsors.vue b/site/components/sponsors.vue index 7930e8b16..b4a11ba48 100644 --- a/site/components/sponsors.vue +++ b/site/components/sponsors.vue @@ -22,12 +22,12 @@ class="sponsorsItem" > bmatch From 2d3a01cd413c6c75878be07e2382453ede92f760 Mon Sep 17 00:00:00 2001 From: maple326 Date: Wed, 10 Apr 2019 22:05:24 +0800 Subject: [PATCH 03/11] Update customize-theme.zh-CN.md (#686) --- docs/vue/customize-theme.zh-CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/vue/customize-theme.zh-CN.md b/docs/vue/customize-theme.zh-CN.md index d9d9dfafd..c5b379634 100644 --- a/docs/vue/customize-theme.zh-CN.md +++ b/docs/vue/customize-theme.zh-CN.md @@ -88,7 +88,7 @@ module.exports = { ### 在 vue cli 3中定制主题 -项目更目录下新建文件`vue.config.js` +项目根目录下新建文件`vue.config.js` ``` // vue.config.js module.exports = { From e5020f7eb830ffbe31e18a6a4f3c377ae8c65f3f Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Fri, 19 Apr 2019 21:30:58 +0800 Subject: [PATCH 04/11] fix: treeSelect not support dataRef #712 --- components/tree-select/index.jsx | 61 ++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/components/tree-select/index.jsx b/components/tree-select/index.jsx index 7becdb024..759e63514 100644 --- a/components/tree-select/index.jsx +++ b/components/tree-select/index.jsx @@ -63,25 +63,28 @@ const TreeSelect = { onChange() { this.$emit('change', ...arguments); }, - updateTreeData(list = []) { - for (let i = 0, len = list.length; i < len; i++) { - const { label, title, scopedSlots = {}, children } = list[i]; - const { $scopedSlots } = this; + updateTreeData(treeData) { + const { $scopedSlots } = this; + return treeData.map(item => { + const { label, title, scopedSlots = {}, children } = item; let newLabel = typeof label === 'function' ? label(this.$createElement) : label; let newTitle = typeof title === 'function' ? title(this.$createElement) : title; if (!newLabel && scopedSlots.label && $scopedSlots[scopedSlots.label]) { - newLabel = $scopedSlots.label(list[i]); + newLabel = $scopedSlots.label(item); } if (!newTitle && scopedSlots.title && $scopedSlots[scopedSlots.title]) { - newTitle = $scopedSlots.title(list[i]); + newTitle = $scopedSlots.title(item); } - const item = { - // label: newLabel, + const treeNodeProps = { + ...item, title: newTitle || newLabel, + dataRef: item, }; - this.updateTreeData(children || []); - Object.assign(list[i], item); - } + if (children) { + return { ...treeNodeProps, children: this.updateTreeData(children) }; + } + return treeNodeProps; + }); }, renderTreeSelect(locale) { const props = getOptionProps(this); @@ -105,7 +108,10 @@ const TreeSelect = { ]); let suffixIcon = getComponentFromProp(this, 'suffixIcon'); suffixIcon = Array.isArray(suffixIcon) ? suffixIcon[0] : suffixIcon; - this.updateTreeData(props.treeData || []); + let treeData = props.treeData; + if (treeData) { + treeData = this.updateTreeData(treeData); + } const cls = { [`${prefixCls}-lg`]: size === 'large', [`${prefixCls}-sm`]: size === 'small', @@ -128,20 +134,23 @@ const TreeSelect = { ); const VcTreeSelectProps = { - props: { - switcherIcon: this.renderSwitcherIcon, - inputIcon, - removeIcon, - clearIcon, - ...rest, - getPopupContainer: getPopupContainer || getContextPopupContainer, - dropdownClassName: classNames(dropdownClassName, `${prefixCls}-tree-dropdown`), - prefixCls, - dropdownStyle: { maxHeight: '100vh', overflow: 'auto', ...dropdownStyle }, - treeCheckable: checkable, - notFoundContent: notFoundContent || locale.notFoundContent, - __propsSymbol__: Symbol(), - }, + props: Object.assign( + { + switcherIcon: this.renderSwitcherIcon, + inputIcon, + removeIcon, + clearIcon, + ...rest, + getPopupContainer: getPopupContainer || getContextPopupContainer, + dropdownClassName: classNames(dropdownClassName, `${prefixCls}-tree-dropdown`), + prefixCls, + dropdownStyle: { maxHeight: '100vh', overflow: 'auto', ...dropdownStyle }, + treeCheckable: checkable, + notFoundContent: notFoundContent || locale.notFoundContent, + __propsSymbol__: Symbol(), + }, + treeData ? { treeData } : {}, + ), class: cls, on: { ...this.$listeners, change: this.onChange }, ref: 'vcTreeSelect', From d970f47b35893d27caac8cd8c107d7dcb92ba691 Mon Sep 17 00:00:00 2001 From: Early Date: Wed, 24 Apr 2019 23:52:43 +0800 Subject: [PATCH 05/11] Fix tooltip destroy tooltip on hide (#727) * fix: add destroyTooltipOnHide prop * doc: destroyTooltipOnHide --- components/tooltip/abstractTooltipProps.js | 1 + components/tooltip/index.en-US.md | 1 + components/tooltip/index.zh-CN.md | 1 + 3 files changed, 3 insertions(+) diff --git a/components/tooltip/abstractTooltipProps.js b/components/tooltip/abstractTooltipProps.js index 1e6cff446..5e987c905 100644 --- a/components/tooltip/abstractTooltipProps.js +++ b/components/tooltip/abstractTooltipProps.js @@ -28,5 +28,6 @@ export default () => ({ getPopupContainer: PropTypes.func, arrowPointAtCenter: PropTypes.bool.def(false), autoAdjustOverflow: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]).def(true), + destroyTooltipOnHide: PropTypes.bool.def(false), align: PropTypes.object.def({}), }); diff --git a/components/tooltip/index.en-US.md b/components/tooltip/index.en-US.md index 0ff307e77..eef7af1e5 100644 --- a/components/tooltip/index.en-US.md +++ b/components/tooltip/index.en-US.md @@ -21,6 +21,7 @@ The following APIs are shared by Tooltip, Popconfirm, Popover. | placement | The position of the tooltip relative to the target, which can be one of `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | `top` | | trigger | Tooltip trigger mode | `hover` \| `focus` \| `click` \| `contextmenu` | `hover` | | visible(v-model) | Whether the floating tooltip card is visible or not | boolean | `false` | +| destroyTooltipOnHide | Whether to destroy tooltip on hide | boolean | false | | align | this value will be merged into placement's config, please refer to the settings [dom-align](https://github.com/yiminghe/dom-align) | Object | - | ### events diff --git a/components/tooltip/index.zh-CN.md b/components/tooltip/index.zh-CN.md index 6e2f6ca2b..9a5b06042 100644 --- a/components/tooltip/index.zh-CN.md +++ b/components/tooltip/index.zh-CN.md @@ -21,6 +21,7 @@ | placement | 气泡框位置,可选 `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | top | | trigger | 触发行为,可选 `hover/focus/click/contextmenu` | string | hover | | visible(v-model) | 用于手动控制浮层显隐 | boolean | false | +| destroyTooltipOnHide | 隐藏后是否销毁tooltip | boolean | false | | align | 该值将合并到 placement 的配置中,设置参考 [dom-align](https://github.com/yiminghe/dom-align) | Object | 无 | ### 事件 From 7d8068be5e16714c2ffea305542841cc1420600a Mon Sep 17 00:00:00 2001 From: wangxueliang Date: Thu, 25 Apr 2019 20:39:00 +0800 Subject: [PATCH 06/11] fix: dynamically setting src error --- components/avatar/Avatar.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/avatar/Avatar.jsx b/components/avatar/Avatar.jsx index dbc971e87..7652bc73e 100644 --- a/components/avatar/Avatar.jsx +++ b/components/avatar/Avatar.jsx @@ -30,6 +30,12 @@ export default { scale: 1, }; }, + watch: { + src() { + this.isImgExist = true; + this.scale = 1; + }, + }, mounted() { this.prevChildren = this.$slots.default; this.prevState = { ...this.$data }; From fa467674720868b773e66defd93c0057ad76552d Mon Sep 17 00:00:00 2001 From: Early Date: Mon, 6 May 2019 09:52:24 +0800 Subject: [PATCH 07/11] fix(ContainerRender): memory leak when invoke removeContainer (#734) --- components/_util/ContainerRender.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/components/_util/ContainerRender.jsx b/components/_util/ContainerRender.jsx index 5dd80381c..65845869c 100644 --- a/components/_util/ContainerRender.jsx +++ b/components/_util/ContainerRender.jsx @@ -36,6 +36,7 @@ export default { this._component && this._component.$destroy(); this.container.parentNode.removeChild(this.container); this.container = null; + this._component = null; } }, From ec0ff990d5346e73e4ed3cc41ccb2c15c4686360 Mon Sep 17 00:00:00 2001 From: nicoklaxit <49637267+nicoklaxit@users.noreply.github.com> Date: Mon, 6 May 2019 17:02:52 +0200 Subject: [PATCH 08/11] Update dropdown-button.md (#742) --- components/dropdown/demo/dropdown-button.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/dropdown/demo/dropdown-button.md b/components/dropdown/demo/dropdown-button.md index 4df822b4f..886997519 100644 --- a/components/dropdown/demo/dropdown-button.md +++ b/components/dropdown/demo/dropdown-button.md @@ -11,7 +11,7 @@ A button is on the left, and a related functional menu is on the right. ```html