@peng_kai/kit 0.3.0-beta.27 → 0.3.0-beta.28

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.
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { useIntervalFn } from '@vueuse/core';
2
+ import { useEventListener, useIntervalFn } from '@vueuse/core';
3
3
  import { Empty, Dropdown, Badge, Menu, MenuItem } from 'ant-design-vue';
4
4
  import { type UseQueryReturnType } from '@tanstack/vue-query'
5
5
  import { watch, ref, computed } from 'vue'
@@ -8,6 +8,7 @@ import { useRouter } from 'vue-router';
8
8
  import audioURL from './y682.mp3?url';
9
9
 
10
10
  const noticeAudio = new Audio(audioURL);
11
+ noticeAudio.muted = true;
11
12
  noticeAudio.src = audioURL;
12
13
  document.body.append(noticeAudio);
13
14
 
@@ -50,6 +51,9 @@ function operate(notice: TNotice) {
50
51
  // watch(noticeNum, (num = 0, oldNum = 0) => {
51
52
  // num > oldNum && noticeAudio.play();
52
53
  // }, { immediate: true });
54
+ useEventListener(document, 'click', () => {
55
+ noticeAudio.muted = false;
56
+ });
53
57
 
54
58
  useIntervalFn(() => {
55
59
  const num = noticeNum.value;
@@ -1,5 +1,5 @@
1
1
  import { Modal as AntModal } from 'ant-design-vue';
2
- import { tryOnBeforeUnmount } from '@vueuse/core';
2
+ import { tryOnBeforeUnmount, tryOnMounted } from '@vueuse/core';
3
3
  import { createVNode, defineComponent, isProxy, onDeactivated, onMounted, reactive, toRef, toRefs } from 'vue';
4
4
  import type { Component } from 'vue';
5
5
  import type { ModalProps } from 'ant-design-vue';
@@ -128,7 +128,7 @@ export function useAntdModal<Comp extends Component>(
128
128
  (compProps as any).onConfirm = onConfirm;
129
129
 
130
130
  tryOnBeforeUnmount(_onClose);
131
- onDeactivated(_onClose);
131
+ tryOnMounted(() => onDeactivated(_onClose));
132
132
 
133
133
  return {
134
134
  PresetComponent,
package/libs/dayjs.ts CHANGED
@@ -12,7 +12,7 @@ import advancedFormat from 'dayjs/esm/plugin/advancedFormat';
12
12
  import customParseFormat from 'dayjs/esm/plugin/customParseFormat';
13
13
  import updateLocale from 'dayjs/esm/plugin/updateLocale';
14
14
  import isBetween from 'dayjs/esm/plugin/isBetween';
15
- import 'dayjs/esm/locale/zh';
15
+ import 'dayjs/esm/locale/zh-cn';
16
16
  import 'dayjs/esm/locale/en';
17
17
 
18
18
  export type { Dayjs, PluginFunc, UnitType, UnitTypeLong, UnitTypeLongPlural, UnitTypeShort, QUnitType, ConfigType, ConfigTypeMap, OpUnitType, OptionType, ManipulateType } from 'dayjs';
@@ -30,4 +30,4 @@ dayjs.extend(advancedFormat);
30
30
  dayjs.extend(customParseFormat);
31
31
  dayjs.extend(updateLocale);
32
32
  dayjs.extend(isBetween);
33
- dayjs.locale('zh');
33
+ dayjs.locale('zh-cn');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@peng_kai/kit",
3
3
  "type": "module",
4
- "version": "0.3.0-beta.27",
4
+ "version": "0.3.0-beta.28",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "ISC",