sadais-piui 1.2.7-beta104 → 1.2.7-beta105

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,7 +21,10 @@
21
21
  >
22
22
  <view class="pi-calendar" :style="[customStyle]" :class="[customClass]">
23
23
  <!-- 标题栏 -->
24
- <view class="pi-justify-center pi-fz-32 pi-fw-500" :style="[{ padding: getTitlePadding }]">
24
+ <view
25
+ class="pi-justify-center pi-fz-32 pi-fw-500"
26
+ :style="[{ padding: getTitlePadding }]"
27
+ >
25
28
  <slot v-if="$slots.title" name="title" />
26
29
  <template v-else>{{ title }}</template>
27
30
  </view>
@@ -47,8 +50,16 @@
47
50
  />
48
51
  <!-- footer -->
49
52
  <view class="pi-w-100P pi-align-center pi-pd-24 pi-solid-top-1">
50
- <view class="pi-flex-sub pi-fz-30 pi-fw-500">{{ getDisplayValue }}</view>
51
- <pi-button type="primary" size="medium" @click="handleConfirm">确定</pi-button>
53
+ <view class="pi-flex-sub pi-fz-30 pi-fw-500">{{
54
+ getDisplayValue
55
+ }}</view>
56
+ <pi-button
57
+ type="primary"
58
+ size="medium"
59
+ :disabled="confirmDisabled"
60
+ @click="handleConfirm"
61
+ >确定</pi-button
62
+ >
52
63
  </view>
53
64
  </view>
54
65
  </pi-popup>
@@ -122,7 +133,10 @@ export default {
122
133
  }
123
134
  },
124
135
  data() {
125
- const mergeCalendarPanel = this.$pi.lang.mergeDeep(calendar.calendarPanel, this.calendarPanel)
136
+ const mergeCalendarPanel = this.$pi.lang.mergeDeep(
137
+ calendar.calendarPanel,
138
+ this.calendarPanel
139
+ )
126
140
  return {
127
141
  calendarValue: mergeCalendarPanel.value
128
142
  }
@@ -139,6 +153,12 @@ export default {
139
153
  },
140
154
  getDisplayValue() {
141
155
  return [].concat(this.calendarValue).join(' - ')
156
+ },
157
+ confirmDisabled() {
158
+ if (this.getCalendarPanel.type === 'range') {
159
+ return this.calendarValue.length !== 2
160
+ }
161
+ return !this.calendarValue
142
162
  }
143
163
  },
144
164
  watch: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7-beta104",
3
+ "version": "1.2.7-beta105",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {