-
Notifications
You must be signed in to change notification settings - Fork 0
JDate
xinwu-yang edited this page Mar 1, 2023
·
1 revision
日期选择组件,ant design的日期组件需要传入moment对象,使用时经常需要先进行转化。用起来不是很方便,于是进行了二次封装,现在只需要传入字符串即可。
<template>
<j-date v-model="dateStr"></j-date>
</template>
<script>
export default {
data() {
return {
dataStr: '2022-01-01'
}
}
}
</script>| 属性 | 说明 | 类型 | 必填 | 默认值 |
|---|---|---|---|---|
| value(v-model) | 值 | string | ||
| placeholder | 默认文字 | string | ||
| dateFormat | 日期格式 | string | 'YYYY-MM-DD' | |
| readOnly | 是否只读 | boolean | false | |
| disabled | 是否禁用 | boolean | false | |
| showTime | 展示时间选择 | boolean | false |
| 事件名称 | 说明 | 回调参数 |
|---|---|---|
| change | 日期选择变化时调用 | function(value) |