-
Notifications
You must be signed in to change notification settings - Fork 14.6k
ChangeLog 2.0.0 alpha.3
杨奕 edited this page Oct 16, 2017
·
14 revisions
-
综合
-
新增全局配置组件尺寸的功能
在引入 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 版本
-
General
-
Configure component sizes globally
Now when you import Element, you can add a global config object with a
size
prop 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
size
attribute will be 'small'.
-
-
Loading
- Now you can customize spinner icon and background color with
spinner
andbackground
prop, #7390
- Now you can customize spinner icon and background color with
-
Autocomplete
- Added
debounce
attribute, #7413
- Added
-
Upload
- Added
limit
andon-exceed
attributes to limit the amount of files, #7405
- Added
-
Menu
- Added
open
andclose
methods to open and close SubMenu programmatically, #7412
- Added
-
DatePicker
- Added
value-format
attribute to customize the format of the binding value, #7367
- Added
-
TimePicker
- Added
arrow-control
attribute to spin the time with arrows #7438
- Added
-
DateTimePicker
- Added
time-arrow-control
attribute to activatearrow-control
of the nesting TimePicker, #7438
- Added
-
Form
- Form and Form-item now have a
size
attribute. Inner components will inherit this size if not specified on themselves, #7428 -
validate
method will now return a promise if the callback is omitted, #7405
- Form and Form-item now have a
- Fixed the console warning
Injection "elFormItem" not found
of some components
- The params of DatePicker's
change
event is now the binding value itself. Its format is controlled byvalue-format
- Input's
change
event 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 useinput
event. - Only compatible with Vue 2.5.2 and beyond