date-of-birth

date of birth
3,321
Install
npm install date-of-birth
Latest Version:1.3.0
Vue:2
License:MIT
Last Updated:Dec 2, 2021
Links: GitHub  ·  npm
Maintainer: chenghuang

date-of-birth

出生日期选择器

安装依赖前准备

1:需安装Vue;
2:需安装Element-UI;

安装依赖

# install dependencies
npm install date-of-birth --save
# or with yarn
yarn add date-of-birth

使用步骤

# 在main.js中引入并注册
import DateOfBirth from 'date-of-birth';
Vue.use(DateOfBirth);
# 在页面中使用
<date-of-birth ref="clear" width="100%" @change="getValue" :title="title"></date-of-birth>

data () {
  return {
    title: {
      year: 'Year',
      month: 'Month',
      day: 'Day',
    }
  }
}
methods: {
  getValue (value) {
    console.log(value); // 'YYYY-MM-DD'
  }
  // 清空选中的值
  clearValue () {
    this.$refs.clear.reset()
  }
}

参数说明

# width (required: false, type: String)
该组件的宽度
# title (required: true, type: Object)
该组件中的title,分别对应年月日,可自定义
# @change
该组件返回的值

Related Packages

vue-datetime

Mobile friendly datetime picker for Vue. Supports date, datetime and time modes,...

683,613 968
vue-datetime3

Mobile friendly datetime picker for Vue. Supports date, datetime and time modes,...

38,734 0
vue3-datetime

Mobile friendly datetime picker for Vue. Supports date, datetime and time modes,...

754 0
vue-date-pick

Date time picker based on Vue

226,081 246

Version History

Version Released Vue License
1.3.0 ^2.5.11 MIT
1.2.9 ^2.5.11 MIT
1.2.8 ^2.5.11 MIT
1.2.7 ^2.5.11 MIT
1.2.6 ^2.5.11 MIT