Blame view

src/components/date-picker/base/confirm.vue 1.54 KB
b9041a0d   梁灏   DatePicker add co...
1
2
  <template>
      <div :class="[prefixCls + '-confirm']">
2dc27713   梁灏   update DateTimePi...
3
          <span :class="timeClasses" v-if="showTime" @click="handleToggleTime">
4ab11811   梁灏   some component su...
4
5
              <template v-if="isTime">{{ t('i.datepicker.selectDate') }}</template>
              <template v-else>{{ t('i.datepicker.selectTime') }}</template>
5cc9b892   梁灏   update DateTimePi...
6
          </span>
531cd165   梁灏   support DatePicke...
7
8
          <i-button size="small" type="text" @click.native="handleClear">{{ t('i.datepicker.clear') }}</i-button>
          <i-button size="small" type="primary" @click.native="handleSuccess">{{ t('i.datepicker.ok') }}</i-button>
b9041a0d   梁灏   DatePicker add co...
9
10
11
12
      </div>
  </template>
  <script>
      import iButton from '../../button/button.vue';
4ab11811   梁灏   some component su...
13
      import Locale from '../../../mixins/locale';
b9041a0d   梁灏   DatePicker add co...
14
15
16
17
  
      const prefixCls = 'ivu-picker';
  
      export default {
4ab11811   梁灏   some component su...
18
          mixins: [ Locale ],
b9041a0d   梁灏   DatePicker add co...
19
          components: { iButton },
5cc9b892   梁灏   update DateTimePi...
20
21
          props: {
              showTime: false,
2dc27713   梁灏   update DateTimePi...
22
23
              isTime: false,
              timeDisabled: false
5cc9b892   梁灏   update DateTimePi...
24
          },
b9041a0d   梁灏   DatePicker add co...
25
26
27
          data () {
              return {
                  prefixCls: prefixCls
b0893113   jingsam   :art: add eslint
28
              };
b9041a0d   梁灏   DatePicker add co...
29
          },
2dc27713   梁灏   update DateTimePi...
30
31
32
33
34
35
36
          computed: {
              timeClasses () {
                  return {
                      [`${prefixCls}-confirm-time-disabled`]: this.timeDisabled
                  };
              }
          },
b9041a0d   梁灏   DatePicker add co...
37
38
39
40
41
42
          methods: {
              handleClear () {
                  this.$emit('on-pick-clear');
              },
              handleSuccess () {
                  this.$emit('on-pick-success');
5cc9b892   梁灏   update DateTimePi...
43
44
              },
              handleToggleTime () {
2dc27713   梁灏   update DateTimePi...
45
                  if (this.timeDisabled) return;
5cc9b892   梁灏   update DateTimePi...
46
                  this.$emit('on-pick-toggle-time');
b9041a0d   梁灏   DatePicker add co...
47
48
              }
          }
b0893113   jingsam   :art: add eslint
49
50
      };
  </script>