bump 2.0.0-beta.3

pull/2763/head
tanjinzhou 2020-08-25 14:17:00 +08:00
parent 0728c900af
commit 6fa4f9cd23
5 changed files with 208 additions and 4 deletions

View File

@ -10,6 +10,107 @@
--- ---
## 2.0.0-beta.3
- ๐Ÿ”ฅ Support Typescript.
- ๐Ÿ”ฅ Added `Space` component.
- ๐Ÿž Fix the problem that some components cannot use css scope [4bdb24](https://github.com/vueComponent/ant-design-vue/commit/4bdb241aa674b50fafa29b3b98e291643f2a06cc).
- ๐Ÿž Fix `List.Meta` registration failure problem [03a42a](https://github.com/vueComponent/ant-design-vue/commit/03a42a5b35e7d42a39aedb1aba8346995be2c27e)
- ๐Ÿž Fix the problem of misalignment in the fixed column of Table [#1493](https://github.com/vueComponent/ant-design-vue/issues/1493)
- ๐Ÿž Fix the problem that the `Button` is not vertically centered [bd71e3](https://github.com/vueComponent/ant-design-vue/commit/bd71e3806b73881f9a95028982d17a10b2cd0b5c)
- ๐Ÿž Fix `Tabs` multiple departure `change` event issue [8ed937](https://github.com/vueComponent/ant-design-vue/commit/8ed937344a57142a575e5272f50933c9c4459a43)
## 2.0.0-beta.2
### Design specification adjustment
- Adjust the row height from `1.5`(`21px`) to `1.5715`(`22px`).
- Basic round corner adjustment, changed from `4px` to `2px`.
- The color brightness of the dividing line is reduced, from `#E8E8E8` to `#F0F0F0`.
- The default background color of Table is changed from transparent to white.
### Compatibility adjustment
- The minimum supported version of IE is IE 11.
- The minimum supported version of Vue is Vue 3.0.
#### Adjusted API
- Removed LocaleProvider, please use `ConfigProvider` instead.
- Removed the afterClose property of Tag.
- Merged FormModel and Form, see the Form refactoring part below for details.
- `tabIndex`, `maxLength`, `readOnly`, `autoComplete`, `autoFocus` are changed to all lowercase.
- 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`.
- All the places where scopedSlots are configured are changed to slots.
- `{ 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`.
- Change xxx.sync to v-model:xxx
- v-model is changed to v-model:xxx, which specifically involves components:
- The components changed from v-model to v-model:checked are: CheckableTag, Checkbox, Switch
- The components changed from v-model to v-model:value are: Radio, Mentions, CheckboxGroup, Rate, DatePicker
- The components changed from v-model to v-model:visible are: Tag, Popconfirm, Popove, Tooltip, Moda, Dropdown
- The components changed from v-model to v-model:activeKey are: Collaps, Tabs
- The components changed from v-model to v-model:current are: Steps
- The components changed from v-model to v-model:selectedKeys are: Menu
#### Icon Upgrade
In `ant-design-vue@1.2.0`, 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).
The old way of using Icon will be obsolete:
```html
<a-icon type="smile" /> <a-button icon="smile" />
```
In 2.0, an on-demand introduction method will be adopted:
```html
<template>
<smile-outlined />
<a-button>
<template v-slot:icon><smile-outlined /></template>
</a-buttom>
</template>
<script>
import SmileOutlined from'@ant-design/icons/SmileOutlined';
export default {
components: {
SmileOutlined
}
}
</script>
```
#### Component refactoring
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.
Involving changes:
- Added `scrollToFirstError`, `name`, `validateTrigger` properties for Form, added `finish`, `finishFailed` events, and added `scrollToField` method.
- Form.Item adds `validateFirst`, `validateTrigger`, and discards the `prop` attribute, and replaces it with `name`.
- 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']).
- 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:
```js
// v1
validateFields((err, value) => {
if (!err) {
// Do something with value
}
});
```
Change to
```js
// v2
validateFields().then(values โ€‹โ€‹=> {
// Do something with value
});
```
## 1.6.4 ## 1.6.4
`2020-07-21` `2020-07-21`

View File

@ -10,6 +10,109 @@
--- ---
## 2.0.0-beta.3
- ๐Ÿ”ฅ ๆ”ฏๆŒ Typescriptใ€‚
- ๐Ÿ”ฅ ๆ–ฐๅขž `Space` ็ป„ไปถใ€‚
- ๐Ÿž ไฟฎๅค้ƒจๅˆ†็ป„ไปถๆ— ๆณ•ไฝฟ็”จ css scope ้—ฎ้ข˜ [4bdb24](https://github.com/vueComponent/ant-design-vue/commit/4bdb241aa674b50fafa29b3b98e291643f2a06cc)ใ€‚
- ๐Ÿž ไฟฎๅค `List.Meta` ๆณจๅ†Œๅคฑ่ดฅ็š„้—ฎ้ข˜ [03a42a](https://github.com/vueComponent/ant-design-vue/commit/03a42a5b35e7d42a39aedb1aba8346995be2c27e)
- ๐Ÿž ไฟฎๅค `Table` ๅ›บๅฎšๅˆ—ๆƒ…ๅ†ตไธ‹้”™ไฝ้—ฎ้ข˜ [#1493](https://github.com/vueComponent/ant-design-vue/issues/1493)
- ๐Ÿž ไฟฎๅค `Button` ๆฒกๆœ‰ๅž‚็›ดๅฑ…ไธญ็š„้—ฎ้ข˜ [bd71e3](https://github.com/vueComponent/ant-design-vue/commit/bd71e3806b73881f9a95028982d17a10b2cd0b5c)
- ๐Ÿž ไฟฎๅค `Tabs` ๅคšๆฌกๅ‡บๅ‘ `change` ไบ‹ไปถ้—ฎ้ข˜ [8ed937](https://github.com/vueComponent/ant-design-vue/commit/8ed937344a57142a575e5272f50933c9c4459a43)
## 2.0.0-beta.2
`2020-08-14`
### ่ฎพ่ฎก่ง„่Œƒ่ฐƒๆ•ด
- ่กŒ้ซ˜ไปŽ `1.5`(`21px`) ่ฐƒๆ•ดไธบ `1.5715`(`22px`)ใ€‚
- ๅŸบ็ก€ๅœ†่ง’่ฐƒๆ•ด๏ผŒ็”ฑ`4px` ๆ”นไธบ `2px`ใ€‚
- ๅˆ†ๅ‰ฒ็บฟ้ขœ่‰ฒๆ˜Žๅบฆ้™ไฝŽ๏ผŒ็”ฑ `#E8E8E8` ๆ”นไธบ `#F0F0F0`ใ€‚
- Table ้ป˜่ฎค่ƒŒๆ™ฏ้ขœ่‰ฒไปŽ้€ๆ˜Žไฟฎๆ”นไธบ็™ฝ่‰ฒใ€‚
### ๅ…ผๅฎนๆ€ง่ฐƒๆ•ด
- IE ๆœ€ไฝŽๆ”ฏๆŒ็‰ˆๆœฌไธบ IE 11ใ€‚
- Vue ๆœ€ไฝŽๆ”ฏๆŒ็‰ˆๆœฌไธบ Vue 3.0ใ€‚
#### ่ฐƒๆ•ด็š„ API
- ็งป้™คไบ† LocaleProvider๏ผŒ่ฏทไฝฟ็”จ `ConfigProvider` ๆ›ฟไปฃใ€‚
- ็งป้™คไบ† Tag ็š„ afterClose ๅฑžๆ€งใ€‚
- ๅˆๅนถไบ† FormModelใ€Form๏ผŒ่ฏฆ่งไธ‹ๆ–น็š„ Form ้‡ๆž„้ƒจๅˆ†ใ€‚
- `tabIndex`ใ€`maxLength`ใ€`readOnly`ใ€`autoComplete`ใ€`autoFocus` ๆ›ดๆ”นไธบๅ…จๅฐๅ†™ใ€‚
- ไธบไบ†ๅœจ template ่ฏญๆณ•ไธญๆ›ดๅ‹ๅฅฝ็š„ไฝฟ็”จๆ’ๆงฝ๏ผŒๆ‰€ๆœ‰ๆถ‰ๅŠๅˆฐ xxxRender, renderXxxx ็š„ๅ‡ๆ”นๆˆๅ•ๅ‚ๆ•ฐ๏ผŒๆถ‰ๅŠๅˆฐ `itemRender`ใ€`renderItem`ใ€`customRender`ใ€`dropdownRender`ใ€`dateCellRender`ใ€`dateFullCellRender`ใ€`monthCellRender`ใ€`monthFullCellRender`ใ€`renderTabBar`ใ€‚
- ๆ‰€ๆœ‰้…็ฝฎ scopedSlots ็š„ๅœฐๆ–น็ปŸไธ€ๆ”นๆˆ slotsใ€‚
- `{ on, props, attrs, ... }` ้…็ฝฎ่ฟ›่กŒๆ‰ๅนณๅŒ–ๅค„็†๏ผŒๅฆ‚ `{ props: {type: 'xxx'}, on: {click: this.handleClick}}` ๆ”นๆˆ `{ type: 'xxx', onClick: this.handleClick }`, ๆถ‰ๅŠ็›ธๅ…ณๅญ—ๆฎต๏ผš`okButtonProps`ใ€`cancelButtonProps`ใ€‚
- xxx.sync ๆ”นๆˆ v-model:xxx
- v-model ๆ›ดๆ”นๆˆ v-model:xxx๏ผŒๅ…ทไฝ“ๆถ‰ๅŠ็ป„ไปถ๏ผš
- v-model ๆ”นๆˆ v-model:checked ็š„็ป„ไปถๆœ‰: CheckableTagใ€Checkboxใ€Switch
- v-model ๆ”นๆˆ v-model:value ็š„็ป„ไปถๆœ‰: Radioใ€Mentionsใ€CheckboxGroupใ€Rateใ€DatePicker
- v-model ๆ”นๆˆ v-model:visible ็š„็ป„ไปถๆœ‰: Tagใ€Popconfirmใ€Popoveใ€Tooltipใ€Modaใ€Dropdown
- v-model ๆ”นๆˆ v-model:activeKey ็š„็ป„ไปถๆœ‰: Collapsใ€Tabs
- v-model ๆ”นๆˆ v-model:current ็š„็ป„ไปถๆœ‰: Steps
- v-model ๆ”นๆˆ v-model:selectedKeys ็š„็ป„ไปถๆœ‰: Menu
#### ๅ›พๆ ‡ๅ‡็บง
ๅœจ `ant-design-vue@1.2.0` ไธญ๏ผŒๆˆ‘ไปฌๅผ•ๅ…ฅไบ† svg ๅ›พๆ ‡๏ผˆ[ไธบไฝ•ไฝฟ็”จ svg ๅ›พๆ ‡๏ผŸ](https://github.com/ant-design/ant-design/issues/10353)๏ผ‰ใ€‚ไฝฟ็”จไบ†ๅญ—็ฌฆไธฒๅ‘ฝๅ็š„ๅ›พๆ ‡ API ๆ— ๆณ•ๅšๅˆฐๆŒ‰้œ€ๅŠ ่ฝฝ๏ผŒๅ› ่€Œๅ…จ้‡ๅผ•ๅ…ฅไบ† svg ๅ›พๆ ‡ๆ–‡ไปถ๏ผŒ่ฟ™ๅคงๅคงๅขžๅŠ ไบ†ๆ‰“ๅŒ…ไบง็‰ฉ็š„ๅฐบๅฏธใ€‚ๅœจ 2.0 ไธญ๏ผŒๆˆ‘ไปฌ่ฐƒๆ•ดไบ†ๅ›พๆ ‡็š„ไฝฟ็”จ API ไปŽ่€Œๆ”ฏๆŒ tree shaking๏ผŒๅ‡ๅฐ‘้ป˜่ฎคๅŒ…ไฝ“็งฏ็บฆ 150 KB(Gzipped)ใ€‚
ๆ—ง็‰ˆ Icon ไฝฟ็”จๆ–นๅผๅฐ†่ขซๅบŸๅผƒ๏ผš
```html
<a-icon type="smile" /> <a-button icon="smile" />
```
2.0 ไธญไผš้‡‡็”จๆŒ‰้œ€ๅผ•ๅ…ฅ็š„ๆ–นๅผ๏ผš
```html
<template>
<smile-outlined />
<a-button>
<template v-slot:icon><smile-outlined /></template>
</a-buttom>
</template>
<script>
import SmileOutlined from '@ant-design/icons/SmileOutlined';
export default {
components: {
SmileOutlined
}
}
</script>
```
#### ็ป„ไปถ้‡ๆž„
ๅœจ 1.x ไธญๆˆ‘ไปฌๆไพ›ไบ† Formใ€FormModel ไธคไธช่กจๅ•็ป„ไปถ๏ผŒๅŽŸๆœ‰็š„ Form ็ป„ไปถไฝฟ็”จ v-decorator ่ฟ›่กŒๆ•ฐๆฎ็ป‘ๅฎš๏ผŒๅœจ Vue2 ไธญๆˆ‘ไปฌ้€š่ฟ‡ไธŠไธ‹ๆ–‡่ฟ›่กŒๅผบๅˆถๆ›ดๆ–ฐ็ป„ไปถ๏ผŒไฝ†ๆ˜ฏๅœจ Vue3 ไธญ๏ผŒ็”ฑไบŽๅผ•ๅ…ฅ patchFlag ็ญ‰ไผ˜ๅŒ–ๆ–นๅผ๏ผŒๅผบๅˆถๅˆทๆ–ฐไผš็ ดๅ patchFlag ๅธฆๆฅ็š„ๆ€ง่ƒฝไผ˜ๅŠฟใ€‚ๆ‰€ไปฅๅœจ 2.0 ็‰ˆๆœฌไธญๆˆ‘ไปฌๅฐ† Formใ€FormModel ่ฟ›่กŒๅˆๅนถ๏ผŒไฟ็•™ไบ† FormModel ็š„ไฝฟ็”จๆ–นๅผ๏ผŒไธฐๅฏŒไบ†็›ธๅ…ณๅŠŸ่ƒฝ๏ผŒๅนถๆ”นๅๆˆ Formใ€‚
ๆถ‰ๅŠๆ”นๅŠจ๏ผš
- Form ๆ–ฐๅขž `scrollToFirstError`,`name`,`validateTrigger` ๅฑžๆ€ง๏ผŒๆ–ฐๅขž `finish`ใ€`finishFailed` ไบ‹ไปถ๏ผŒๆ–ฐๅขž `scrollToField` ๆ–นๆณ•ใ€‚
- Form.Item ๆ–ฐๅขž `validateFirst`, `validateTrigger`, ๅบŸๅผƒ `prop` ๅฑžๆ€ง๏ผŒไฝฟ็”จ `name` ๆ›ฟๆขใ€‚
- ๅตŒๅฅ—ๅญ—ๆฎต่ทฏๅพ„ไฝฟ็”จๆ•ฐ็ป„๏ผŒ่ฟ‡ๅŽป็‰ˆๆœฌๆˆ‘ไปฌ้€š่ฟ‡ . ไปฃ่กจๅตŒๅฅ—่ทฏๅพ„๏ผˆ่ฏธๅฆ‚ user.name ๆฅไปฃ่กจ { user: { name: '' } }๏ผ‰ใ€‚็„ถ่€Œๅœจไธ€ไบ›ๅŽๅฐ็ณป็ปŸไธญ๏ผŒๅ˜้‡ๅไธญไนŸไผšๅธฆไธŠ .ใ€‚่ฟ™้€ ๆˆ็”จๆˆท้œ€่ฆ้ขๅค–็š„ไปฃ็ ่ฟ›่กŒ่ฝฌๅŒ–๏ผŒๅ› ่€Œๆ–ฐ็‰ˆไธญ๏ผŒๅตŒๅฅ—่ทฏๅพ„้€š่ฟ‡ๆ•ฐ็ป„ๆฅ่กจ็คบไปฅ้ฟๅ…้”™่ฏฏ็š„ๅค„็†่กŒไธบ๏ผˆๅฆ‚ ['user', 'name']๏ผ‰ใ€‚
- validateFields ไธๅ†ๆ”ฏๆŒ callbackใ€‚validateFields ไผš่ฟ”ๅ›ž Promise ๅฏน่ฑก๏ผŒๅ› ่€Œไฝ ๅฏไปฅ้€š่ฟ‡ async/await ๆˆ–่€… then/catch ๆฅๆ‰ง่กŒๅฏนๅบ”็š„้”™่ฏฏๅค„็†ใ€‚ไธๅ†้œ€่ฆๅˆคๆ–ญ errors ๆ˜ฏๅฆไธบ็ฉบ๏ผš
```js
// v1
validateFields((err, value) => {
if (!err) {
// Do something with value
}
});
```
ๆ”นๆˆ
```js
// v2
validateFields().then(values => {
// Do something with value
});
```
## 1.6.4 ## 1.6.4
`2020-07-21` `2020-07-21`

@ -1 +1 @@
Subproject commit 31e7b308adb6eabb97c003fbc7883e4d00c8f764 Subproject commit 83ab203d1ab9861132f6efd1e74015507c0e45f6

View File

@ -191,7 +191,7 @@ const Form = {
); );
if (!this.model) { if (!this.model) {
warning(false, 'Form', 'model is required for validateFields to work.'); warning(false, 'Form', 'model is required for validateFields to work.');
return; return Promise.reject('Form `model` is required for validateFields to work.');
} }
const provideNameList = !!nameList; const provideNameList = !!nameList;
const namePathList = provideNameList ? toArray(nameList).map(getNamePath) : []; const namePathList = provideNameList ? toArray(nameList).map(getNamePath) : [];

View File

@ -1,6 +1,6 @@
{ {
"name": "ant-design-vue", "name": "ant-design-vue",
"version": "2.0.0-beta.2", "version": "2.0.0-beta.3",
"title": "Ant Design Vue", "title": "Ant Design Vue",
"description": "An enterprise-class UI design language and Vue-based implementation", "description": "An enterprise-class UI design language and Vue-based implementation",
"keywords": [ "keywords": [
@ -184,7 +184,7 @@
"xhr-mock": "^2.5.1" "xhr-mock": "^2.5.1"
}, },
"dependencies": { "dependencies": {
"@ant-design/icons-vue": "^5.1.1", "@ant-design/icons-vue": "^5.1.4",
"@babel/runtime": "^7.10.5", "@babel/runtime": "^7.10.5",
"@simonwep/pickr": "~1.7.0", "@simonwep/pickr": "~1.7.0",
"add-dom-event-listener": "^1.0.2", "add-dom-event-listener": "^1.0.2",