Table of Contents
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
新特性
-
综合
-
新增全局配置组件尺寸的功能
在引入 Element 时,配置
size字段可以改变所有组件的默认尺寸。按照引入 Element 的方式,具体操作如下:完整引入 Element:
import Vue from 'vue' import Element from 'element-ui' Vue.use(Element, { size: 'small' })按需引入 Element:
import Vue from 'vue' import { Button } from 'element-ui' Vue.prototype.$ELEMENT = { size: 'small' } Vue.use(Button)按照以上设置,项目中所有拥有
size属性的组件的默认尺寸均为 'small'。
-
-
Loading
- 配置对象新增
spinner和background字段,支持自定义加载图标和背景色,#7390
- 配置对象新增
-
Autocomplete
- 新增
debounce属性,#7413
- 新增
-
Upload
- 新增
limit和on-exceed属性,支持对上传文件的个数进行限制,#7405
- 新增
-
Menu
- 新增
open和close方法,支持手动打开和关闭 SubMenu,#7412
- 新增
-
DatePicker
- 新增
value-format属性,支持对绑定值的格式进行自定义,#7367
- 新增
-
TimePicker
- 新增
arrow-control属性,提供另一种交互形式,#7438
- 新增
-
DateTimePicker
- 新增
time-arrow-control属性,用于开启时间选择器的arrow-control,#7438
- 新增
-
Form
- Form 和 Form-item 新增
size属性,用于控制表单内组件的尺寸,#7428 validate方法在不传入 callback 的情况下返回 promise,#7405
- Form 和 Form-item 新增
修复
- 修复部分组件的
Injection "elFormItem" not found报错
非兼容性更新
- DatePicker 的
change事件参数现在为组件的绑定值,格式由value-format控制 - Input 组件的
change事件现在仅在输入框失去焦点或用户按下回车时触发,与原生 input 元素一致。如果需要实时响应用户的输入,可以使用input事件 - 最低兼容 Vue 2.5.2 版本
New features
-
General
-
Configure component sizes globally
Now when you import Element, you can add a global config object with a
sizeprop to configure default sizes for all components:Fully import:
import Vue from 'vue' import Element from 'element-ui' Vue.use(Element, { size: 'small' })Partial import:
import Vue from 'vue' import { Button } from 'element-ui' Vue.prototype.$ELEMENT = { size: 'small' } Vue.use(Button)With the above config, the default size of all components that have
sizeattribute will be 'small'.
-
-
Loading
- Now you can customize spinner icon and background color with
spinnerandbackgroundprop, #7390
- Now you can customize spinner icon and background color with
-
Autocomplete
- Added
debounceattribute, #7413
- Added
-
Upload
- Added
limitandon-exceedattributes to limit the amount of files, #7405
- Added
-
Menu
- Added
openandclosemethods to open and close SubMenu programmatically, #7412
- Added
-
DatePicker
- Added
value-formatattribute to customize the format of the binding value, #7367
- Added
-
TimePicker
- Added
arrow-controlattribute to spin the time with arrows #7438
- Added
-
DateTimePicker
- Added
time-arrow-controlattribute to activatearrow-controlof the nesting TimePicker, #7438
- Added
-
Form
Fixes
- Fixed the console warning
Injection "elFormItem" not foundof some components
Breaking changes
- The params of DatePicker's
changeevent is now the binding value itself. Its format is controlled byvalue-format - Input's
changeevent now behaves like the native input element, which triggers only on blur or pressing enter. If you need to respond to user input in real time, you can useinputevent. - Only compatible with Vue 2.5.2 and beyond