Skip to content

Commit 6ad0f9d

Browse files
committed
Merge remote-tracking branch 'origin/next' into v3
2 parents 770e9cc + 7e1301a commit 6ad0f9d

File tree

12 files changed

+47
-25
lines changed

12 files changed

+47
-25
lines changed

CHANGELOG.en-US.md

+8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010

1111
---
1212

13+
## 2.2.0-beta.2
14+
15+
`2021-06-08`
16+
17+
- 🐞 Fix PageHeader display extension problem [4de73](https://github.com/vueComponent/ant-design-vue/commit/4de7737907d485d3dd3be44b70e599cc53edb171)
18+
- 🐞 Fix the problem that some components cannot be rendered normally under Vue3.1[#4173](https://github.com/vueComponent/ant-design-vue/issues/4173)
19+
- 🐞 Fix Menu.Divider name error problem [6c5c84](https://github.com/vueComponent/ant-design-vue/commit/6c5c84a3fc4b8abcd7aed0922852a64e0ac293c7)
20+
1321
## 2.2.0-beta.1
1422

1523
`2021-06-17`

CHANGELOG.zh-CN.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,17 @@
1010

1111
---
1212

13+
## 2.2.0-beta.2
14+
15+
`2021-06-08`
16+
17+
- 🐞 修复 PageHeader 显示多余字符问题 [4de773](https://github.com/vueComponent/ant-design-vue/commit/4de7737907d485d3dd3be44b70e599cc53edb171)
18+
- 🐞 修复部分组件不能在 Vue3.1 下不能正常渲染问题 [#4173](https://github.com/vueComponent/ant-design-vue/issues/4173)
19+
- 🐞 修复 Menu.Divider 名称错误问题 [6c5c84](https://github.com/vueComponent/ant-design-vue/commit/6c5c84a3fc4b8abcd7aed0922852a64e0ac293c7)
20+
1321
## 2.2.0-beta.1
1422

15-
`2021-06-17`
23+
`2021-06-07`
1624

1725
- 🔥🔥🔥 虚拟 Table 独立库发布 https://www.npmjs.com/package/@surely-vue/table , 该组件是一个独立的库,目前文档示例尚未完善,他是一个完全 ts 开发的组件,有较好的类型提示,npm 上已有 API 文档,着急使用的的可以摸索着用起来了,这里有个在线体验示例,https://store.antdv.com/pro/preview/list/big-table-list
1826
- 🔥🔥🔥 重构大量组件,源码更加易读,性能更优,ts 类型更加全面

components/auto-complete/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const AutoComplete = defineComponent({
4242
OptGroup: { ...OptGroup, name: 'AAutoCompleteOptGroup' },
4343
setup(props, { slots }) {
4444
warning(
45-
!('dataSource' in props || 'dataSource' in slots),
45+
!(props.dataSource !== undefined || 'dataSource' in slots),
4646
'AutoComplete',
4747
'`dataSource` is deprecated, please use `options` instead.',
4848
);

components/form/Form.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const Form = defineComponent({
9696
}),
9797
Item: FormItem,
9898
emits: ['finishFailed', 'submit', 'finish'],
99-
setup(props, { emit, slots, expose }) {
99+
setup(props, { emit, slots, expose, attrs }) {
100100
const size = useInjectSize(props);
101101
const { prefixCls, direction, form: contextForm } = useConfigInject('form', props);
102102
const requiredMark = computed(() => props.requiredMark === '' || props.requiredMark);
@@ -339,7 +339,7 @@ const Form = defineComponent({
339339

340340
return () => {
341341
return (
342-
<form onSubmit={handleSubmit} class={formClassName.value}>
342+
<form {...attrs} onSubmit={handleSubmit} class={[formClassName.value, attrs.class]}>
343343
{slots.default?.()}
344344
</form>
345345
);

components/layout/layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ function generator({ suffixCls, tagName, name }: GeneratorArgument) {
2727
const { prefixCls } = useConfigInject(suffixCls, props);
2828
return () => {
2929
const basicComponentProps = {
30+
...props,
3031
prefixCls: prefixCls.value,
3132
tagName,
32-
...props,
3333
};
3434
return <BasicComponent {...basicComponentProps}>{slots.default?.()}</BasicComponent>;
3535
};

components/menu/src/Divider.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineComponent } from 'vue';
22

33
export default defineComponent({
4-
name: 'Divider',
4+
name: 'AMenuDivider',
55
props: {
66
prefixCls: String,
77
},

components/menu/src/Menu.tsx

+4-5
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export default defineComponent({
123123
{ immediate: true },
124124
);
125125
watchEffect(() => {
126-
if ('activeKey' in props) {
126+
if (props.activeKey !== undefined) {
127127
let keys = [];
128128
const menuInfo = props.activeKey
129129
? (keyMapStore.value[props.activeKey] as UnwrapRef<StoreMenuInfo>)
@@ -194,7 +194,7 @@ export default defineComponent({
194194
selectedKeys: newSelectedKeys,
195195
};
196196
if (!shallowEqual(newSelectedKeys, mergedSelectedKeys.value)) {
197-
if (!('selectedKeys' in props)) {
197+
if (props.selectedKeys === undefined) {
198198
mergedSelectedKeys.value = newSelectedKeys;
199199
}
200200
emit('update:selectedKeys', newSelectedKeys);
@@ -223,11 +223,10 @@ export default defineComponent({
223223
);
224224

225225
const changeActiveKeys = (keys: Key[]) => {
226-
if ('activeKey' in props) {
227-
emit('update:activeKey', keys[keys.length - 1]);
228-
} else {
226+
if (props.activeKey === undefined) {
229227
activeKeys.value = keys;
230228
}
229+
emit('update:activeKey', keys[keys.length - 1]);
231230
};
232231
const disabled = computed(() => !!props.disabled);
233232
const isRtl = computed(() => direction.value === 'rtl');

components/page-header/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ const PageHeader = defineComponent({
145145
<div class={className}>
146146
{renderBreadcrumb()}
147147
{renderTitle()}
148-
{children.length && renderChildren(children)}
148+
{children.length ? renderChildren(children) : null}
149149
{renderFooter()}
150150
</div>
151151
</ResizeObserver>

components/switch/index.tsx

+12-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
computed,
88
onMounted,
99
nextTick,
10+
watch,
1011
} from 'vue';
1112
import LoadingOutlined from '@ant-design/icons-vue/LoadingOutlined';
1213
import PropTypes from '../_util/vue-types';
@@ -27,7 +28,6 @@ const switchProps = {
2728
checkedChildren: PropTypes.any,
2829
unCheckedChildren: PropTypes.any,
2930
tabindex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
30-
defaultChecked: PropTypes.looseBool,
3131
autofocus: PropTypes.looseBool,
3232
loading: PropTypes.looseBool,
3333
checked: PropTypes.looseBool,
@@ -59,6 +59,14 @@ const Switch = defineComponent({
5959
'`value` is not validate prop, do you mean `checked`?',
6060
);
6161
});
62+
const checked = ref(props.checked !== undefined ? !!props.checked : !!attrs.defaultChecked);
63+
64+
watch(
65+
() => props.checked,
66+
() => {
67+
checked.value = !!props.checked;
68+
},
69+
);
6270

6371
const configProvider = inject('configProvider', defaultConfigProvider);
6472
const { getPrefixCls } = configProvider;
@@ -75,9 +83,6 @@ const Switch = defineComponent({
7583
const prefixCls = computed(() => {
7684
return getPrefixCls('switch', props.prefixCls);
7785
});
78-
const checked = computed(() => {
79-
return 'checked' in props ? !!props.checked : !!props.defaultChecked;
80-
});
8186

8287
onMounted(() => {
8388
nextTick(() => {
@@ -91,6 +96,9 @@ const Switch = defineComponent({
9196
if (props.disabled) {
9297
return;
9398
}
99+
if (props.checked === undefined) {
100+
checked.value = check;
101+
}
94102
emit('update:checked', check);
95103
emit('change', check, e);
96104
};

components/tag/index.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export type TagProps = HTMLAttributes & Partial<ExtractPropTypes<typeof tagProps
4444

4545
const Tag = defineComponent({
4646
name: 'ATag',
47+
props: tagProps,
4748
emits: ['update:visible', 'close'],
4849
setup(props: TagProps, { slots, emit, attrs }) {
4950
const { getPrefixCls } = inject('configProvider', defaultConfigProvider);
@@ -137,8 +138,6 @@ const Tag = defineComponent({
137138
},
138139
});
139140

140-
Tag.props = tagProps;
141-
142141
Tag.CheckableTag = CheckableTag;
143142

144143
Tag.install = function(app: App) {

components/typography/Base.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ const Base = defineComponent<InternalBlockProps>({
155155
);
156156

157157
watchEffect(() => {
158-
if (!('content' in props)) {
158+
if (props.content === undefined) {
159159
warning(
160160
!props.editable,
161161
'Typography',
@@ -437,7 +437,7 @@ const Base = defineComponent<InternalBlockProps>({
437437
const { editing } = editable.value;
438438
const children =
439439
props.ellipsis || props.editable
440-
? 'content' in props
440+
? props.content !== undefined
441441
? props.content
442442
: slots.default?.()
443443
: slots.default

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ant-design-vue",
3-
"version": "2.2.0-beta.1",
3+
"version": "2.2.0-beta.2",
44
"title": "Ant Design Vue",
55
"description": "An enterprise-class UI design language and Vue-based implementation",
66
"keywords": [
@@ -58,8 +58,8 @@
5858
},
5959
"homepage": "https://www.antdv.com/",
6060
"peerDependencies": {
61-
"@vue/compiler-sfc": ">=3.0.9",
62-
"vue": ">=3.0.9"
61+
"@vue/compiler-sfc": ">=3.1.0",
62+
"vue": ">=3.1.0"
6363
},
6464
"devDependencies": {
6565
"@babel/cli": "^7.8.4",
@@ -89,7 +89,7 @@
8989
"@typescript-eslint/parser": "^4.1.0",
9090
"@vue/babel-plugin-jsx": "^1.0.0",
9191
"@vue/cli-plugin-eslint": "^4.0.0",
92-
"@vue/compiler-sfc": "^3.0.9",
92+
"@vue/compiler-sfc": "^3.1.0",
9393
"@vue/eslint-config-prettier": "^6.0.0",
9494
"@vue/eslint-config-typescript": "^7.0.0",
9595
"@vue/test-utils": "^2.0.0-0",
@@ -179,7 +179,7 @@
179179
"umi-mock-middleware": "^1.0.0",
180180
"umi-request": "^1.3.5",
181181
"url-loader": "^3.0.0",
182-
"vue": "^3.0.9",
182+
"vue": "^3.1.0",
183183
"vue-antd-md-loader": "^1.2.1-beta.1",
184184
"vue-clipboard2": "0.3.1",
185185
"vue-draggable-resizable": "^2.1.0",

0 commit comments

Comments
 (0)