Skip to content

Commit 6fa4f9c

Browse files
committed
bump 2.0.0-beta.3
1 parent 0728c90 commit 6fa4f9c

File tree

5 files changed

+208
-4
lines changed

5 files changed

+208
-4
lines changed

CHANGELOG.en-US.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,107 @@
1010

1111
---
1212

13+
## 2.0.0-beta.3
14+
15+
- 🔥 Support Typescript.
16+
- 🔥 Added `Space` component.
17+
- 🐞 Fix the problem that some components cannot use css scope [4bdb24](https://github.com/vueComponent/ant-design-vue/commit/4bdb241aa674b50fafa29b3b98e291643f2a06cc).
18+
- 🐞 Fix `List.Meta` registration failure problem [03a42a](https://github.com/vueComponent/ant-design-vue/commit/03a42a5b35e7d42a39aedb1aba8346995be2c27e)
19+
- 🐞 Fix the problem of misalignment in the fixed column of Table [#1493](https://github.com/vueComponent/ant-design-vue/issues/1493)
20+
- 🐞 Fix the problem that the `Button` is not vertically centered [bd71e3](https://github.com/vueComponent/ant-design-vue/commit/bd71e3806b73881f9a95028982d17a10b2cd0b5c)
21+
- 🐞 Fix `Tabs` multiple departure `change` event issue [8ed937](https://github.com/vueComponent/ant-design-vue/commit/8ed937344a57142a575e5272f50933c9c4459a43)
22+
23+
## 2.0.0-beta.2
24+
25+
### Design specification adjustment
26+
27+
- Adjust the row height from `1.5`(`21px`) to `1.5715`(`22px`).
28+
- Basic round corner adjustment, changed from `4px` to `2px`.
29+
- The color brightness of the dividing line is reduced, from `#E8E8E8` to `#F0F0F0`.
30+
- The default background color of Table is changed from transparent to white.
31+
32+
### Compatibility adjustment
33+
34+
- The minimum supported version of IE is IE 11.
35+
- The minimum supported version of Vue is Vue 3.0.
36+
37+
#### Adjusted API
38+
39+
- Removed LocaleProvider, please use `ConfigProvider` instead.
40+
- Removed the afterClose property of Tag.
41+
- Merged FormModel and Form, see the Form refactoring part below for details.
42+
- `tabIndex`, `maxLength`, `readOnly`, `autoComplete`, `autoFocus` are changed to all lowercase.
43+
- In order to use the slot more friendly in template syntax, all related to xxxRender, renderXxxx are changed to single parameter, involving `itemRender`, `renderItem`, `customRender`, `dropdownRender`, `dateCellRender`, `dateFullCellRender`, `monthCellRender`, `monthFullCellRender`, `renderTabBar`.
44+
- All the places where scopedSlots are configured are changed to slots.
45+
- `{ on, props, attrs, ... }` configuration is flattened, such as `{ props: {type:'xxx'}, on: {click: this.handleClick}}` changed to `{ type: 'xxx', onClick: this.handleClick }`, related fields: `okButtonProps`, `cancelButtonProps`.
46+
- Change xxx.sync to v-model:xxx
47+
- v-model is changed to v-model:xxx, which specifically involves components:
48+
49+
- The components changed from v-model to v-model:checked are: CheckableTag, Checkbox, Switch
50+
- The components changed from v-model to v-model:value are: Radio, Mentions, CheckboxGroup, Rate, DatePicker
51+
- The components changed from v-model to v-model:visible are: Tag, Popconfirm, Popove, Tooltip, Moda, Dropdown
52+
- The components changed from v-model to v-model:activeKey are: Collaps, Tabs
53+
- The components changed from v-model to v-model:current are: Steps
54+
- The components changed from v-model to v-model:selectedKeys are: Menu
55+
56+
#### Icon Upgrade
57+
58+
In `[email protected]`, we introduced the svg icon ([Why use the svg icon?](https://github.com/ant-design/ant-design/issues/10353)). The icon API that uses string naming cannot be loaded on demand, so the svg icon file is fully introduced, which greatly increases the size of the packaged product. In 2.0, we adjusted the icon usage API to support tree shaking, reducing the default package size by approximately 150 KB (Gzipped).
59+
60+
The old way of using Icon will be obsolete:
61+
62+
```html
63+
<a-icon type="smile" /> <a-button icon="smile" />
64+
```
65+
66+
In 2.0, an on-demand introduction method will be adopted:
67+
68+
```html
69+
<template>
70+
<smile-outlined />
71+
<a-button>
72+
<template v-slot:icon><smile-outlined /></template>
73+
</a-buttom>
74+
</template>
75+
<script>
76+
import SmileOutlined from'@ant-design/icons/SmileOutlined';
77+
export default {
78+
components: {
79+
SmileOutlined
80+
}
81+
}
82+
</script>
83+
```
84+
85+
#### Component refactoring
86+
87+
In 1.x, we provide two form components, Form and FormModel. The original Form component uses v-decorator for data binding. In Vue2, we use context to force update components. However, in Vue3, due to the introduction of patchFlag, etc. Optimization method, forced refresh will destroy the performance advantage brought by patchFlag. So in version 2.0, we merged Form and FormModel, retained the use of FormModel, enriched related functions, and renamed it to Form.
88+
89+
Involving changes:
90+
91+
- Added `scrollToFirstError`, `name`, `validateTrigger` properties for Form, added `finish`, `finishFailed` events, and added `scrollToField` method.
92+
- Form.Item adds `validateFirst`, `validateTrigger`, and discards the `prop` attribute, and replaces it with `name`.
93+
- The nested field path uses an array. In the past version, we used. To represent the nested path (such as user.name to represent {user: {name:''} }). However, in some back-end systems, the variable name will also carry .. This causes users to need additional codes for conversion. Therefore, in the new version, nested paths are represented by arrays to avoid wrong handling behaviors (such as ['user','name']).
94+
- validateFields no longer supports callback. validateFields will return a Promise object, so you can perform corresponding error handling through async/await or then/catch. It is no longer necessary to determine whether errors is empty:
95+
96+
```js
97+
// v1
98+
validateFields((err, value) => {
99+
if (!err) {
100+
// Do something with value
101+
}
102+
});
103+
```
104+
105+
Change to
106+
107+
```js
108+
// v2
109+
validateFields().then(values ​​=> {
110+
// Do something with value
111+
});
112+
```
113+
13114
## 1.6.4
14115

15116
`2020-07-21`

CHANGELOG.zh-CN.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,109 @@
1010

1111
---
1212

13+
## 2.0.0-beta.3
14+
15+
- 🔥 支持 Typescript。
16+
- 🔥 新增 `Space` 组件。
17+
- 🐞 修复部分组件无法使用 css scope 问题 [4bdb24](https://github.com/vueComponent/ant-design-vue/commit/4bdb241aa674b50fafa29b3b98e291643f2a06cc)
18+
- 🐞 修复 `List.Meta` 注册失败的问题 [03a42a](https://github.com/vueComponent/ant-design-vue/commit/03a42a5b35e7d42a39aedb1aba8346995be2c27e)
19+
- 🐞 修复 `Table` 固定列情况下错位问题 [#1493](https://github.com/vueComponent/ant-design-vue/issues/1493)
20+
- 🐞 修复 `Button` 没有垂直居中的问题 [bd71e3](https://github.com/vueComponent/ant-design-vue/commit/bd71e3806b73881f9a95028982d17a10b2cd0b5c)
21+
- 🐞 修复 `Tabs` 多次出发 `change` 事件问题 [8ed937](https://github.com/vueComponent/ant-design-vue/commit/8ed937344a57142a575e5272f50933c9c4459a43)
22+
23+
## 2.0.0-beta.2
24+
25+
`2020-08-14`
26+
27+
### 设计规范调整
28+
29+
- 行高从 `1.5`(`21px`) 调整为 `1.5715`(`22px`)。
30+
- 基础圆角调整,由`4px` 改为 `2px`
31+
- 分割线颜色明度降低,由 `#E8E8E8` 改为 `#F0F0F0`
32+
- Table 默认背景颜色从透明修改为白色。
33+
34+
### 兼容性调整
35+
36+
- IE 最低支持版本为 IE 11。
37+
- Vue 最低支持版本为 Vue 3.0。
38+
39+
#### 调整的 API
40+
41+
- 移除了 LocaleProvider,请使用 `ConfigProvider` 替代。
42+
- 移除了 Tag 的 afterClose 属性。
43+
- 合并了 FormModel、Form,详见下方的 Form 重构部分。
44+
- `tabIndex``maxLength``readOnly``autoComplete``autoFocus` 更改为全小写。
45+
- 为了在 template 语法中更友好的使用插槽,所有涉及到 xxxRender, renderXxxx 的均改成单参数,涉及到 `itemRender``renderItem``customRender``dropdownRender``dateCellRender``dateFullCellRender``monthCellRender``monthFullCellRender``renderTabBar`
46+
- 所有配置 scopedSlots 的地方统一改成 slots。
47+
- `{ on, props, attrs, ... }` 配置进行扁平化处理,如 `{ props: {type: 'xxx'}, on: {click: this.handleClick}}` 改成 `{ type: 'xxx', onClick: this.handleClick }`, 涉及相关字段:`okButtonProps``cancelButtonProps`
48+
- xxx.sync 改成 v-model:xxx
49+
- v-model 更改成 v-model:xxx,具体涉及组件:
50+
51+
- v-model 改成 v-model:checked 的组件有: CheckableTag、Checkbox、Switch
52+
- v-model 改成 v-model:value 的组件有: Radio、Mentions、CheckboxGroup、Rate、DatePicker
53+
- v-model 改成 v-model:visible 的组件有: Tag、Popconfirm、Popove、Tooltip、Moda、Dropdown
54+
- v-model 改成 v-model:activeKey 的组件有: Collaps、Tabs
55+
- v-model 改成 v-model:current 的组件有: Steps
56+
- v-model 改成 v-model:selectedKeys 的组件有: Menu
57+
58+
#### 图标升级
59+
60+
`[email protected]` 中,我们引入了 svg 图标([为何使用 svg 图标?](https://github.com/ant-design/ant-design/issues/10353))。使用了字符串命名的图标 API 无法做到按需加载,因而全量引入了 svg 图标文件,这大大增加了打包产物的尺寸。在 2.0 中,我们调整了图标的使用 API 从而支持 tree shaking,减少默认包体积约 150 KB(Gzipped)。
61+
62+
旧版 Icon 使用方式将被废弃:
63+
64+
```html
65+
<a-icon type="smile" /> <a-button icon="smile" />
66+
```
67+
68+
2.0 中会采用按需引入的方式:
69+
70+
```html
71+
<template>
72+
<smile-outlined />
73+
<a-button>
74+
<template v-slot:icon><smile-outlined /></template>
75+
</a-buttom>
76+
</template>
77+
<script>
78+
import SmileOutlined from '@ant-design/icons/SmileOutlined';
79+
export default {
80+
components: {
81+
SmileOutlined
82+
}
83+
}
84+
</script>
85+
```
86+
87+
#### 组件重构
88+
89+
在 1.x 中我们提供了 Form、FormModel 两个表单组件,原有的 Form 组件使用 v-decorator 进行数据绑定,在 Vue2 中我们通过上下文进行强制更新组件,但是在 Vue3 中,由于引入 patchFlag 等优化方式,强制刷新会破坏 patchFlag 带来的性能优势。所以在 2.0 版本中我们将 Form、FormModel 进行合并,保留了 FormModel 的使用方式,丰富了相关功能,并改名成 Form。
90+
91+
涉及改动:
92+
93+
- Form 新增 `scrollToFirstError`,`name`,`validateTrigger` 属性,新增 `finish``finishFailed` 事件,新增 `scrollToField` 方法。
94+
- Form.Item 新增 `validateFirst`, `validateTrigger`, 废弃 `prop` 属性,使用 `name` 替换。
95+
- 嵌套字段路径使用数组,过去版本我们通过 . 代表嵌套路径(诸如 user.name 来代表 { user: { name: '' } })。然而在一些后台系统中,变量名中也会带上 .。这造成用户需要额外的代码进行转化,因而新版中,嵌套路径通过数组来表示以避免错误的处理行为(如 ['user', 'name'])。
96+
- validateFields 不再支持 callback。validateFields 会返回 Promise 对象,因而你可以通过 async/await 或者 then/catch 来执行对应的错误处理。不再需要判断 errors 是否为空:
97+
98+
```js
99+
// v1
100+
validateFields((err, value) => {
101+
if (!err) {
102+
// Do something with value
103+
}
104+
});
105+
```
106+
107+
改成
108+
109+
```js
110+
// v2
111+
validateFields().then(values => {
112+
// Do something with value
113+
});
114+
```
115+
13116
## 1.6.4
14117

15118
`2020-07-21`

antdv-demo

components/form/Form.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ const Form = {
191191
);
192192
if (!this.model) {
193193
warning(false, 'Form', 'model is required for validateFields to work.');
194-
return;
194+
return Promise.reject('Form `model` is required for validateFields to work.');
195195
}
196196
const provideNameList = !!nameList;
197197
const namePathList = provideNameList ? toArray(nameList).map(getNamePath) : [];

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ant-design-vue",
3-
"version": "2.0.0-beta.2",
3+
"version": "2.0.0-beta.3",
44
"title": "Ant Design Vue",
55
"description": "An enterprise-class UI design language and Vue-based implementation",
66
"keywords": [
@@ -184,7 +184,7 @@
184184
"xhr-mock": "^2.5.1"
185185
},
186186
"dependencies": {
187-
"@ant-design/icons-vue": "^5.1.1",
187+
"@ant-design/icons-vue": "^5.1.4",
188188
"@babel/runtime": "^7.10.5",
189189
"@simonwep/pickr": "~1.7.0",
190190
"add-dom-event-listener": "^1.0.2",

0 commit comments

Comments
 (0)