withc580231

Date of birth

date of birth

Version Version: 1.2.7 Version Updated: 12/27/2021 By: withc580231 License: MIT

DownloadsLast30Days: 1.5k

https://github.com/withc580231/date-of-birth

npm i date-of-birth
yarn add date-of-birth

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
该组件返回的值

Copyright © 2020 vuejscomponent.com