date-picker-range.vue 1.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
<template>
<div class="ibiz-date-picker">
  <div class="date-picker-text">{{$t('components.dateRange.startText')}}</div>
  <el-date-picker
    v-model="value"
    type="daterange"
    :range-separator="rangeSeparatorr ? rangeSeparatorr : $t('components.dateRange.rangeSeparatorr')"
    :start-placeholder="startPlaceholder ? startPlaceholder : $t('components.dateRange.startPlaceholder')"
    :end-placeholder="endPlaceholder ? endPlaceholder : $t('components.dateRange.endPlaceholder')"
    :disabled="disabled"
    value-format="yyyy-MM-dd"
    @change="change"
    :format="format"
  ></el-date-picker>
  <div class="date-picker-text">{{$t('components.dateRange.endText')}}</div>
</div>

</template>
<script lang = 'ts'>
import { Component, Vue, Model, Prop } from "vue-property-decorator";

@Component({
})
export default class DateRange extends Vue {
  /**
   * 日期格式
   * @type {any}
   * @memberof DateRange
   */
  @Prop() format?: string;
  
  /**
   * 是否禁用
   *
   * @type {*}
   * @memberof DateRange
   */
  @Prop() public disabled?: boolean;

  /**
   * 结束日期Placeholder
   *
   * @type {*}
   * @memberof DateRange
   */
  @Prop() public endPlaceholder?: string;

  /**
   * 中间Placeholder
   *
   * @type {*}
   * @memberof DateRange
   */
  @Prop() public rangeSeparatorr?: string;

  /**
   * 开始日期Placeholder
   *
   * @type {*}
   * @memberof DateRange
   */
  @Prop() public startPlaceholder?: string;

  /**
   * 双向绑定值
   * @type {any}
   * @memberof DateRange
   */
  @Prop() value?: any;



  /**
   * 选中时间事件
   * @type {any}
   * @memberof DateRange
   */
  public change() {
    this.$emit("on-change", this.value);
  }



  /**
   * 编辑器名称
   *
   * @type {string}
   * @memberof DateRange
   */
  @Prop() public name?: string;

  
}
</script>
<style lang = "less">
@import "./date-picker-range.less";
</style>