2016-07-27 14:15:02 +08:00
|
|
|
|
<script>
|
|
|
|
|
module.exports = {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2016-10-08 12:25:55 +08:00
|
|
|
|
pickerOptions0: {
|
|
|
|
|
disabledDate(time) {
|
2017-09-23 12:46:37 +08:00
|
|
|
|
return time.getTime() > Date.now();
|
2016-10-08 12:25:55 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2016-07-27 14:15:02 +08:00
|
|
|
|
pickerOptions1: {
|
2016-10-08 12:25:55 +08:00
|
|
|
|
disabledDate(time) {
|
2016-10-18 14:29:05 +08:00
|
|
|
|
return time.getTime() < Date.now() - 8.64e7;
|
2016-10-08 12:25:55 +08:00
|
|
|
|
},
|
2016-07-27 14:15:02 +08:00
|
|
|
|
shortcuts: [{
|
|
|
|
|
text: '今天',
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
picker.$emit('pick', new Date());
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: '昨天',
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const date = new Date();
|
|
|
|
|
date.setTime(date.getTime() - 3600 * 1000 * 24);
|
|
|
|
|
picker.$emit('pick', date);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: '一周前',
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const date = new Date();
|
|
|
|
|
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
|
|
picker.$emit('pick', date);
|
|
|
|
|
}
|
|
|
|
|
}]
|
|
|
|
|
},
|
|
|
|
|
pickerOptions2: {
|
|
|
|
|
shortcuts: [{
|
|
|
|
|
text: '最近一周',
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: '最近一个月',
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: '最近三个月',
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}]
|
2016-08-11 12:20:29 +08:00
|
|
|
|
},
|
2016-10-08 12:25:55 +08:00
|
|
|
|
value1: '',
|
2016-08-11 12:20:29 +08:00
|
|
|
|
value2: '',
|
|
|
|
|
value3: '',
|
|
|
|
|
value4: '',
|
|
|
|
|
value5: '',
|
|
|
|
|
value6: '',
|
2017-10-10 17:49:41 +08:00
|
|
|
|
value7: '',
|
|
|
|
|
value8: '',
|
|
|
|
|
value9: '',
|
|
|
|
|
value10: '',
|
|
|
|
|
value11: ''
|
2016-07-27 14:15:02 +08:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
2016-08-29 19:01:42 +08:00
|
|
|
|
<style>
|
|
|
|
|
.demo-block.demo-date-picker .source {
|
|
|
|
|
padding: 0;
|
|
|
|
|
display: flex;
|
|
|
|
|
}
|
2016-09-20 21:18:20 +08:00
|
|
|
|
|
2016-08-29 19:01:42 +08:00
|
|
|
|
.demo-date-picker .block {
|
|
|
|
|
padding: 30px 0;
|
|
|
|
|
text-align: center;
|
|
|
|
|
border-right: solid 1px #EFF2F6;
|
|
|
|
|
flex: 1;
|
|
|
|
|
&:last-child {
|
|
|
|
|
border-right: none;
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-09-20 21:18:20 +08:00
|
|
|
|
|
2016-08-29 19:01:42 +08:00
|
|
|
|
.demo-date-picker .demonstration {
|
|
|
|
|
display: block;
|
|
|
|
|
color: #8492a6;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
2016-07-27 14:15:02 +08:00
|
|
|
|
|
2016-11-07 16:25:56 +08:00
|
|
|
|
## DatePicker 日期选择器
|
2016-07-27 14:15:02 +08:00
|
|
|
|
|
2016-08-29 19:01:42 +08:00
|
|
|
|
用于选择或输入日期
|
2016-07-27 14:15:02 +08:00
|
|
|
|
|
2016-08-29 19:01:42 +08:00
|
|
|
|
### 选择日
|
2016-07-27 14:15:02 +08:00
|
|
|
|
|
2016-08-29 19:01:42 +08:00
|
|
|
|
以「日」为基本单位,基础的日期选择控件
|
2016-07-27 14:15:02 +08:00
|
|
|
|
|
2016-10-08 12:25:55 +08:00
|
|
|
|
:::demo 基本单位由`type`属性指定。快捷选项需配置`picker-options`对象中的`shortcuts`,禁用日期通过 `disabledDate` 设置,传入函数
|
2016-07-27 14:15:02 +08:00
|
|
|
|
```html
|
2016-08-29 19:01:42 +08:00
|
|
|
|
<template>
|
|
|
|
|
<div class="block">
|
|
|
|
|
<span class="demonstration">默认</span>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="value1"
|
|
|
|
|
type="date"
|
2016-10-08 12:25:55 +08:00
|
|
|
|
placeholder="选择日期"
|
|
|
|
|
:picker-options="pickerOptions0">
|
2016-08-29 19:01:42 +08:00
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="block">
|
|
|
|
|
<span class="demonstration">带快捷选项</span>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="value2"
|
2016-10-12 17:41:49 +08:00
|
|
|
|
align="right"
|
2016-08-29 19:01:42 +08:00
|
|
|
|
type="date"
|
|
|
|
|
placeholder="选择日期"
|
|
|
|
|
:picker-options="pickerOptions1">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
2016-07-27 14:15:02 +08:00
|
|
|
|
|
|
|
|
|
<script>
|
2016-08-29 19:01:42 +08:00
|
|
|
|
export default {
|
2016-07-27 14:15:02 +08:00
|
|
|
|
data() {
|
2016-09-21 13:39:38 +08:00
|
|
|
|
return {
|
2016-10-08 12:25:55 +08:00
|
|
|
|
pickerOptions0: {
|
|
|
|
|
disabledDate(time) {
|
2017-09-23 12:46:37 +08:00
|
|
|
|
return time.getTime() > Date.now();
|
2016-10-08 12:25:55 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
2016-09-21 13:39:38 +08:00
|
|
|
|
pickerOptions1: {
|
|
|
|
|
shortcuts: [{
|
|
|
|
|
text: '今天',
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
picker.$emit('pick', new Date());
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: '昨天',
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const date = new Date();
|
|
|
|
|
date.setTime(date.getTime() - 3600 * 1000 * 24);
|
|
|
|
|
picker.$emit('pick', date);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: '一周前',
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const date = new Date();
|
|
|
|
|
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
|
|
picker.$emit('pick', date);
|
|
|
|
|
}
|
|
|
|
|
}]
|
|
|
|
|
},
|
|
|
|
|
value1: '',
|
|
|
|
|
value2: '',
|
|
|
|
|
};
|
2016-07-27 14:15:02 +08:00
|
|
|
|
}
|
2016-09-21 13:39:38 +08:00
|
|
|
|
};
|
2016-07-27 14:15:02 +08:00
|
|
|
|
</script>
|
|
|
|
|
```
|
2016-08-29 19:01:42 +08:00
|
|
|
|
:::
|
2016-07-27 14:15:02 +08:00
|
|
|
|
|
2016-08-29 19:01:42 +08:00
|
|
|
|
### 其他日期单位
|
2016-07-27 14:15:02 +08:00
|
|
|
|
|
2016-08-29 19:01:42 +08:00
|
|
|
|
通过扩展基础的日期选择,可以选择周、月、年
|
2016-07-27 14:15:02 +08:00
|
|
|
|
|
2016-09-20 21:18:20 +08:00
|
|
|
|
:::demo
|
2016-07-27 14:15:02 +08:00
|
|
|
|
```html
|
2016-08-29 19:01:42 +08:00
|
|
|
|
<div class="block">
|
|
|
|
|
<span class="demonstration">周</span>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="value3"
|
|
|
|
|
type="week"
|
|
|
|
|
format="yyyy 第 WW 周"
|
|
|
|
|
placeholder="选择周">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="block">
|
|
|
|
|
<span class="demonstration">月</span>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="value4"
|
|
|
|
|
type="month"
|
|
|
|
|
placeholder="选择月">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="block">
|
|
|
|
|
<span class="demonstration">年</span>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="value5"
|
2016-10-12 17:41:49 +08:00
|
|
|
|
align="right"
|
2016-08-29 19:01:42 +08:00
|
|
|
|
type="year"
|
|
|
|
|
placeholder="选择年">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
2016-11-14 18:10:52 +08:00
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
value3: '',
|
|
|
|
|
value4: '',
|
|
|
|
|
value5: ''
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
2016-07-27 14:15:02 +08:00
|
|
|
|
```
|
2016-08-29 19:01:42 +08:00
|
|
|
|
:::
|
2016-07-27 14:15:02 +08:00
|
|
|
|
|
2016-08-29 19:01:42 +08:00
|
|
|
|
### 选择日期范围
|
2016-07-27 14:15:02 +08:00
|
|
|
|
|
2016-08-29 19:01:42 +08:00
|
|
|
|
可在一个选择器中便捷地选择一个时间范围
|
2016-07-27 14:15:02 +08:00
|
|
|
|
|
2016-09-20 21:18:20 +08:00
|
|
|
|
:::demo
|
2016-07-27 14:15:02 +08:00
|
|
|
|
```html
|
2016-08-29 19:01:42 +08:00
|
|
|
|
<template>
|
|
|
|
|
<div class="block">
|
|
|
|
|
<span class="demonstration">默认</span>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="value6"
|
|
|
|
|
type="daterange"
|
2017-09-23 12:46:37 +08:00
|
|
|
|
range-separator="至"
|
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
|
end-placeholder="结束日期">
|
2016-08-29 19:01:42 +08:00
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="block">
|
|
|
|
|
<span class="demonstration">带快捷选项</span>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="value7"
|
|
|
|
|
type="daterange"
|
2016-09-21 12:46:53 +08:00
|
|
|
|
align="right"
|
2017-09-23 12:46:37 +08:00
|
|
|
|
range-separator="至"
|
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
|
end-placeholder="结束日期"
|
2016-12-28 18:33:45 +08:00
|
|
|
|
:picker-options="pickerOptions2">
|
2016-08-29 19:01:42 +08:00
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
2016-07-27 14:15:02 +08:00
|
|
|
|
|
|
|
|
|
<script>
|
2016-08-29 19:01:42 +08:00
|
|
|
|
export default {
|
2016-07-27 14:15:02 +08:00
|
|
|
|
data() {
|
2016-09-21 13:39:38 +08:00
|
|
|
|
return {
|
|
|
|
|
pickerOptions2: {
|
|
|
|
|
shortcuts: [{
|
|
|
|
|
text: '最近一周',
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: '最近一个月',
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: '最近三个月',
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
const end = new Date();
|
|
|
|
|
const start = new Date();
|
|
|
|
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
|
|
|
|
picker.$emit('pick', [start, end]);
|
|
|
|
|
}
|
|
|
|
|
}]
|
|
|
|
|
},
|
|
|
|
|
value6: '',
|
|
|
|
|
value7: ''
|
|
|
|
|
};
|
2016-07-27 14:15:02 +08:00
|
|
|
|
}
|
2016-09-21 13:39:38 +08:00
|
|
|
|
};
|
2016-07-27 14:15:02 +08:00
|
|
|
|
</script>
|
|
|
|
|
```
|
2016-08-29 19:01:42 +08:00
|
|
|
|
:::
|
2016-07-27 14:15:02 +08:00
|
|
|
|
|
2017-10-10 17:49:41 +08:00
|
|
|
|
### 默认显示日期
|
|
|
|
|
|
|
|
|
|
未选择日期时,默认显示今天的日历。使用`default-value`可以指定其他日期,该值需要能够被`new Date()`解析。
|
|
|
|
|
类型为`daterange`时,指定左侧日历的日期。
|
|
|
|
|
|
|
|
|
|
:::demo
|
|
|
|
|
```html
|
|
|
|
|
<template>
|
|
|
|
|
<div class="block">
|
|
|
|
|
<span class="demonstration">date</span>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="value8"
|
|
|
|
|
type="date"
|
|
|
|
|
placeholder="选择日期"
|
|
|
|
|
default-value="2010-10-01">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="block">
|
|
|
|
|
<span class="demonstration">daterange</span>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="value9"
|
|
|
|
|
type="daterange"
|
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
|
end-placeholder="结束日期"
|
|
|
|
|
default-value="2010-10-01">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
value8: '',
|
|
|
|
|
value9: ''
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
```
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
|
|
### 返回值格式
|
|
|
|
|
|
|
|
|
|
默认情况下,组件接受并返回`Date`对象。
|
|
|
|
|
使用`value-format`指定返回值的格式,支持的格式与`format`相同。
|
|
|
|
|
|
|
|
|
|
:::warning
|
|
|
|
|
该功能处于测试阶段,欢迎提供反馈。
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
|
|
:::demo
|
|
|
|
|
```html
|
|
|
|
|
<template>
|
|
|
|
|
<div class="block">
|
|
|
|
|
<span class="demonstration">默认为 Date 对象</span>
|
|
|
|
|
<div class="demonstration">组件值:{{ value10 }}</div>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="value10"
|
|
|
|
|
type="date"
|
|
|
|
|
placeholder="选择日期"
|
|
|
|
|
format="yyyy 年 MM 月 dd 日">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="block">
|
|
|
|
|
<span class="demonstration">使用 value-format 进行格式化</span>
|
|
|
|
|
<div class="demonstration">组件值:{{ value11 }}</div>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="value11"
|
|
|
|
|
type="date"
|
|
|
|
|
placeholder="选择日期"
|
|
|
|
|
format="yyyy 年 MM 月 dd 日"
|
|
|
|
|
value-format="yyyy-MM-dd">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
value10: '',
|
|
|
|
|
value11: '',
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
```
|
|
|
|
|
:::
|
|
|
|
|
|
2016-08-29 19:01:42 +08:00
|
|
|
|
### Attributes
|
2016-07-27 14:15:02 +08:00
|
|
|
|
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
|
|
|
|---------- |-------------- |---------- |-------------------------------- |-------- |
|
2016-11-13 11:45:38 +08:00
|
|
|
|
| readonly | 完全只读 | boolean | — | false |
|
2016-12-29 20:53:33 +08:00
|
|
|
|
| disabled | 禁用 | boolean | — | false |
|
|
|
|
|
| editable | 文本框可输入 | boolean | — | true |
|
|
|
|
|
| clearable | 是否显示清除按钮 | boolean | — | true |
|
2016-12-09 00:06:34 +08:00
|
|
|
|
| size | 输入框尺寸 | string | large, small, mini | — |
|
2017-09-23 12:46:37 +08:00
|
|
|
|
| placeholder | 非范围选择时的占位内容 | string | — | — |
|
|
|
|
|
| start-placeholder | 范围选择时开始日期的占位内容 | string | — | — |
|
|
|
|
|
| end-placeholder | 范围选择时结束日期的占位内容 | string | — | — |
|
2016-12-13 22:52:29 +08:00
|
|
|
|
| type | 显示类型 | string | year/month/date/week/ datetime/datetimerange/daterange | date |
|
2017-10-10 18:06:01 +08:00
|
|
|
|
| format | 显示在输入框中的格式 | string | 年 `yyyy`,月 `MM`,日 `dd`,小时 `HH`,分 `mm`,秒 `ss` | yyyy-MM-dd |
|
2016-10-08 12:25:55 +08:00
|
|
|
|
| align | 对齐方式 | string | left, center, right | left |
|
2016-12-20 16:38:47 +08:00
|
|
|
|
| popper-class | DatePicker 下拉框的类名 | string | — | — |
|
2017-10-10 17:49:41 +08:00
|
|
|
|
| picker-options | 当前时间日期选择器特有的选项参考下表 | object | — | {} |
|
|
|
|
|
| range-separator | 选择范围时的分隔符 | string | — | '-' |
|
|
|
|
|
| default-value | 可选,选择器打开时默认显示的时间 | Date | 可被`new Date()`解析 | — |
|
2017-10-10 18:06:01 +08:00
|
|
|
|
| value-format | 可选,绑定值的格式。不指定则绑定值为 Date 对象 | string | 年 `yyyy`,月 `MM`,日 `dd`,小时 `HH`,分 `mm`,秒 `ss` | — |
|
2017-07-30 16:26:05 +08:00
|
|
|
|
| name | 原生属性 | string | — | — |
|
2016-10-08 12:25:55 +08:00
|
|
|
|
|
|
|
|
|
### Picker Options
|
|
|
|
|
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
|
|
|
|---------- |-------------- |---------- |-------------------------------- |-------- |
|
2016-12-29 20:53:33 +08:00
|
|
|
|
| shortcuts | 设置快捷选项,需要传入 { text, onClick } 对象用法参考 demo 或下表 | Object[] | — | — |
|
|
|
|
|
| disabledDate | 设置禁用状态,参数为当前日期,要求返回 Boolean | Function | — | — |
|
2016-12-27 16:28:16 +08:00
|
|
|
|
| firstDayOfWeek | 周起始日 | Number | 1 到 7 | 7 |
|
2017-10-10 18:06:01 +08:00
|
|
|
|
| onPick | 选中日期后会执行的回调,只有当 `daterange` 或 `datetimerange` 才生效 | Function({ maxDate, minDate }) | — | — |
|
2016-07-27 14:15:02 +08:00
|
|
|
|
|
2016-08-29 19:01:42 +08:00
|
|
|
|
### Shortcuts
|
2016-07-27 14:15:02 +08:00
|
|
|
|
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
|
|
|
|---------- |-------------- |---------- |-------------------------------- |-------- |
|
2016-09-02 13:56:47 +08:00
|
|
|
|
| text | 标题文本 | string | — | — |
|
2016-12-13 22:52:29 +08:00
|
|
|
|
| onClick | 选中后的回调函数,参数是 vm,可通过触发 'pick' 事件设置选择器的值。例如 vm.$emit('pick', new Date()) | function | — | — |
|
2016-12-23 17:34:40 +08:00
|
|
|
|
|
|
|
|
|
### Events
|
2016-12-29 17:20:59 +08:00
|
|
|
|
| 事件名称 | 说明 | 回调参数 |
|
2016-12-23 17:34:40 +08:00
|
|
|
|
|---------|--------|---------|
|
2017-10-10 18:06:01 +08:00
|
|
|
|
| change | 用户确认选定的值时触发 | 组件绑定值。格式与绑定值一致,可受 `value-format` 控制 |
|
2017-07-17 18:24:24 +08:00
|
|
|
|
| blur | 当 input 失去焦点时触发 | (event: Event) |
|
|
|
|
|
| focus | 当 input 获得焦点时触发 | (event: Event) |
|
2017-07-18 13:47:35 +08:00
|
|
|
|
|
|
|
|
|
### Methods
|
|
|
|
|
| 方法名 | 说明 | 参数 |
|
|
|
|
|
| ---- | ---- | ---- |
|
2017-10-10 18:06:01 +08:00
|
|
|
|
| focus | 使 input 获取焦点 | — |
|