2.3.3 • Published 1 year ago

vue-datepicker-z v2.3.3

Weekly downloads
31
License
ISC
Repository
-
Last release
1 year ago

vue-date-picker-z

a vue component of calendar

移动端PC端日期选择器(>=vue2.0)

使用方法

npm安装

npm install vue-date-picker-z
import DatePicker from 'vue-date-picker-z'
Vue.use(DatePicker);

Quickstart

<template>
   <p>对于pc端的在点击时间上增加.stop</p>
   <input class="date-ipt" @click.stop="show_date" v-model="date_demo" readonly>
  <div class="date-time-item">
      <input class="date-ipt" @click="show_date" v-model="date_demo" readonly>
      <date-picker
          ref="datePicker"
          type="dateTime"
          :defaultDate="date_demo"
          :min="minDate"
          :max="maxDate"
          @confirm="confirmDate"
      ></date-picker>
  </div>
</template>

<script>
export default {
  data() {
          return {
              date_demo: "",
              minDate: "",
              maxDate: ""
          };
      },
      components: {
          DatePicker
      },
      methods: {
          show_date(ev) {//
                // 对于pc端需要而且一定要传点击事件
                this.$refs.datePicker.hideDatePicker();
                var _self = this;
                setTimeout(()=> {
                    this.$refs.datePicker.show(ev);
                },50);

                this.$refs.datePicker.show(); // 移动端直接调用
          },
          confirmDate(date) {
              this.date_demo = date;
          }
      }
};

</script>

属性

名称类型默认值说明
defaultDateString-日期
typeString'dateTime'年月日时分选择模式(默认),date:年月日选择模式;time:时间段选择模式
colorString-背景及文字颜色(默认"#417df4")
minString-最小值
maxString-最大值

事件

名称说明回调
confirm当前所选日期确定回调参数为当前所选日期

方法

名称说明默认值
show通过this.$refs.datePicker.show()显示日历
2.3.3

1 year ago

2.3.2

4 years ago

2.3.1

4 years ago

2.2.11

4 years ago

2.2.7

4 years ago

2.2.10

4 years ago

2.2.9

4 years ago

2.2.8

4 years ago

2.2.1

4 years ago

2.2.3

4 years ago

2.2.2

4 years ago

2.2.5

4 years ago

2.2.4

4 years ago

2.2.6

4 years ago

2.1.11

4 years ago

1.1.11

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.10

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago