mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-02 20:18:22 +08:00
feat: merge master
This commit is contained in:
commit
00f104757c
@ -36,6 +36,7 @@ export default {
|
||||
this._component && this._component.$destroy();
|
||||
this.container.parentNode.removeChild(this.container);
|
||||
this.container = null;
|
||||
this._component = null;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -11,7 +11,7 @@ A button is on the left, and a related functional menu is on the right.
|
||||
```html
|
||||
<template>
|
||||
<div>
|
||||
<a-dropdown-button @click="handleMenuClick">
|
||||
<a-dropdown-button @click="handleButtonClick">
|
||||
Dropdown
|
||||
<a-menu slot="overlay" @click="handleMenuClick">
|
||||
<a-menu-item key="1"><a-icon type="user" />1st menu item</a-menu-item>
|
||||
|
@ -49,9 +49,7 @@ const LocaleProvider = {
|
||||
...this.locale,
|
||||
exist: true,
|
||||
};
|
||||
this.$nextTick(() => {
|
||||
setMomentLocale(val);
|
||||
});
|
||||
setMomentLocale(val);
|
||||
},
|
||||
},
|
||||
created() {
|
||||
|
@ -24,6 +24,7 @@ export default {
|
||||
okButtonProps,
|
||||
cancelButtonProps,
|
||||
iconType = 'question-circle',
|
||||
closable = false,
|
||||
} = props;
|
||||
warning(
|
||||
!('iconType' in props),
|
||||
@ -73,6 +74,7 @@ export default {
|
||||
wrapClassName={classNames({ [`${contentPrefixCls}-centered`]: !!centered })}
|
||||
onCancel={e => close({ triggerCancel: true }, e)}
|
||||
visible={visible}
|
||||
closable={closable}
|
||||
title=""
|
||||
transitionName={transitionName}
|
||||
footer=""
|
||||
|
@ -54,6 +54,7 @@ The properties of the object are follows:
|
||||
| autoFocusButton | Specify which button to autofocus | null\|string: `ok` `cancel` | `ok` |
|
||||
| cancelText | Text of the Cancel button | string | `Cancel` |
|
||||
| centered | Centered Modal | Boolean | `false` |
|
||||
| closable | Whether a close (x) button is visible on top right of the modal dialog or not | boolean | `false` |
|
||||
| class | class of container | string | - |
|
||||
| content | Content | string\|vNode | - |
|
||||
| icon | custom icon (`Added in 1.40.0`) | string\|slot | `<Icon type="question-circle">` |
|
||||
|
@ -53,6 +53,7 @@
|
||||
| autoFocusButton | 指定自动获得焦点的按钮 | null\|string: `ok` `cancel` | `ok` |
|
||||
| cancelText | 取消按钮文字 | string | 取消 |
|
||||
| centered | 垂直居中展示 Modal | Boolean | `false` |
|
||||
| closable | 是否显示右上角的关闭按钮 | boolean | `false` |
|
||||
| class | 容器类名 | string | - |
|
||||
| content | 内容 | string\|vNode | 无 |
|
||||
| icon | 自定义图标(1.40.0 新增) | string\|slot | `<Icon type="question-circle">` |
|
||||
|
@ -7,10 +7,6 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
.@{ant-prefix}-modal-close {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.@{ant-prefix}-modal-body {
|
||||
padding: 32px 32px 24px;
|
||||
}
|
||||
|
@ -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({}),
|
||||
});
|
||||
|
@ -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
|
||||
|
@ -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 | 无 |
|
||||
|
||||
### 事件
|
||||
|
@ -59,25 +59,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;
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
@ -109,7 +112,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',
|
||||
|
@ -88,7 +88,7 @@ module.exports = {
|
||||
|
||||
### 在 vue cli 3中定制主题
|
||||
|
||||
项目更目录下新建文件`vue.config.js`
|
||||
项目根目录下新建文件`vue.config.js`
|
||||
```
|
||||
// vue.config.js
|
||||
module.exports = {
|
||||
|
@ -7,7 +7,7 @@
|
||||
<img
|
||||
width="150"
|
||||
alt="Vue 实战教程"
|
||||
src="https://cdn.nlark.com/yuque/0/2019/jpeg/87084/1552980096914-assets/web-upload/ec3701d2-34ed-4274-b8f4-e0592e020db0.jpeg"
|
||||
src="https://cdn.nlark.com/yuque/0/2019/jpeg/87084/1554903088531-assets/web-upload/c496a156-aabc-4a9b-8cb6-a7a6617706ce.jpeg"
|
||||
>
|
||||
</a>
|
||||
</div>
|
||||
|
@ -304,7 +304,7 @@ export default {
|
||||
</div>
|
||||
</a-locale-provider>
|
||||
{ name.indexOf('back-top') === -1 ? <a-back-top /> : null }
|
||||
<Geektime />
|
||||
{ isCN && <Geektime /> }
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
@ -22,12 +22,12 @@
|
||||
class="sponsorsItem"
|
||||
>
|
||||
<a
|
||||
href="https://www.bmatch.tech/?ref=ant-design-vue"
|
||||
href="https://www.youkeda.com?from=vue"
|
||||
target="_blank"
|
||||
>
|
||||
<img
|
||||
height="61"
|
||||
src="https://cdn.nlark.com/yuque/0/2019/png/87084/1552279877057-assets/web-upload/48a6ba91-6750-478c-956f-57aedb632fe5.png"
|
||||
height="66"
|
||||
src="https://cdn.nlark.com/yuque/0/2019/jpeg/87084/1554903046813-assets/web-upload/2dfca1bb-6927-4044-841d-2b0c9f908295.jpeg"
|
||||
alt="bmatch"
|
||||
>
|
||||
</a>
|
||||
|
@ -36,7 +36,9 @@
|
||||
font-weight: 500;
|
||||
background: rgba(0, 0, 0, 0.02);
|
||||
}
|
||||
.api-container pre code {
|
||||
|
||||
pre > code[class*='lang-'],
|
||||
pre > code[class*='language-'] {
|
||||
padding: 12px 20px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
6
types/form/form.d.ts
vendored
6
types/form/form.d.ts
vendored
@ -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' {
|
||||
|
Loading…
Reference in New Issue
Block a user