yh-mobile-components 1.1.0 → 1.1.1

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.
@@ -186,21 +186,21 @@
186
186
  </template>
187
187
 
188
188
  <script setup lang="ts">
189
- import dayjs, { Dayjs } from "dayjs";
189
+ import dayjs from "dayjs";
190
190
  import { ref, computed, watch, onMounted } from "vue";
191
191
  import { cloneDeep } from "lodash-es";
192
192
 
193
193
  const props = withDefaults(
194
194
  defineProps<{
195
195
  type: "year" | "month" | "date" | "datetime" | "time";
196
- modelValue: Dayjs;
196
+ modelValue: dayjs.Dayjs;
197
197
  }>(),
198
198
  {}
199
199
  );
200
200
 
201
201
  const emits = defineEmits<{
202
- (e: "update:modelValue", date: Dayjs);
203
- (e: "change", date: Dayjs);
202
+ (e: "update:modelValue", date: dayjs.Dayjs);
203
+ (e: "change", date: dayjs.Dayjs);
204
204
  }>();
205
205
 
206
206
  const divType = ref("day");
@@ -243,7 +243,7 @@ const momentDay = computed(() => {
243
243
  const changeType = computed(() => {
244
244
  return divType.value === "day" ? "month" : "year";
245
245
  });
246
- const rows = computed<Dayjs[][]>(() => {
246
+ const rows = computed<dayjs.Dayjs[][]>(() => {
247
247
  if (divType.value === "day") {
248
248
  // 指定月份第一天
249
249
  let mMFD = viewDate.value.date(1);
@@ -256,13 +256,13 @@ const rows = computed<Dayjs[][]>(() => {
256
256
  } else {
257
257
  lastIndex = mMDays - (mMLW - 7);
258
258
  }
259
- let items: Dayjs[] = [];
259
+ let items: dayjs.Dayjs[] = [];
260
260
  for (let i = firstIndex; i < lastIndex; i++) {
261
261
  let day = mMFD.add(i, "day");
262
262
  items.push(day);
263
263
  }
264
264
  let powLen = Math.ceil(items.length / 7);
265
- let result: Dayjs[][] = [];
265
+ let result: dayjs.Dayjs[][] = [];
266
266
  for (let j = 0; j < powLen; j++) {
267
267
  result.push(items.splice(0, 7));
268
268
  }
@@ -271,23 +271,23 @@ const rows = computed<Dayjs[][]>(() => {
271
271
  let mMFD = viewDate.value.month();
272
272
  let firstIndex = 0 - mMFD;
273
273
  let lastIndex = -(mMFD - 12);
274
- let items: Dayjs[] = [];
274
+ let items: dayjs.Dayjs[] = [];
275
275
  for (let i = firstIndex; i < lastIndex; i++) {
276
276
  let month = viewDate.value.add(i, "month");
277
277
  items.push(month);
278
278
  }
279
- let result: Dayjs[][] = [];
279
+ let result: dayjs.Dayjs[][] = [];
280
280
  for (let j = 0; j < 4; j++) {
281
281
  result.push(items.splice(0, 3));
282
282
  }
283
283
  return result;
284
284
  } else {
285
- let items: Dayjs[] = [];
285
+ let items: dayjs.Dayjs[] = [];
286
286
  for (let i = -11; i < 13; i++) {
287
287
  let year = viewDate.value.add(i, "year");
288
288
  items.push(year);
289
289
  }
290
- let result: Dayjs[][] = [];
290
+ let result: dayjs.Dayjs[][] = [];
291
291
  for (let j = 0; j < 4; j++) {
292
292
  result.push(items.splice(0, 3));
293
293
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yh-mobile-components",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "移动端组件封装及配置化需求",
5
5
  "main": "index.js",
6
6
  "scripts": {