bump 2.0.0-beta.3
parent
0728c900af
commit
6fa4f9cd23
|
@ -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`
|
||||||
|
|
|
@ -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
|
|
@ -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) : [];
|
||||||
|
|
|
@ -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",
|
||||||
|
|
Loadingโฆ
Reference in New Issue