mrxy-yk 1.3.5 → 1.4.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.
- package/dist/element-plus/components/form-dialog/FormDialog.d.ts +1 -0
- package/dist/element-plus/components/form-dialog/FormDialog.vue.js +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/life-cycle/index.d.ts +7 -0
- package/dist/hooks/life-cycle/index.js +14 -0
- package/dist/hooks/setup-module/index.d.ts +41 -0
- package/dist/hooks/setup-module/index.js +33 -0
- package/dist/hooks/setup-module/type.d.ts +4 -0
- package/dist/index.js +5 -0
- package/dist/utils/amap/@type/Marker.d.ts +2 -0
- package/package.json +1 -1
- package/web-types.json +2 -2
|
@@ -254,6 +254,7 @@ declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, Comp
|
|
|
254
254
|
modal: boolean;
|
|
255
255
|
appendToBody: boolean;
|
|
256
256
|
fullscreen: boolean;
|
|
257
|
+
showClose: boolean;
|
|
257
258
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
258
259
|
formRef: {
|
|
259
260
|
$: ComponentInternalInstance;
|
|
@@ -20,7 +20,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
20
20
|
fullscreen: { type: Boolean, default: false },
|
|
21
21
|
closeOnClickModal: { type: Boolean },
|
|
22
22
|
dialogCenter: { type: Boolean },
|
|
23
|
-
showClose: { type: Boolean }
|
|
23
|
+
showClose: { type: Boolean, default: true }
|
|
24
24
|
},
|
|
25
25
|
setup(__props) {
|
|
26
26
|
const props = __props;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { onMounted, onActivated } from "vue";
|
|
2
|
+
function onReactivated(hook) {
|
|
3
|
+
let isMounted = false;
|
|
4
|
+
onMounted(() => {
|
|
5
|
+
isMounted = true;
|
|
6
|
+
});
|
|
7
|
+
onActivated(() => {
|
|
8
|
+
if (isMounted) isMounted = false;
|
|
9
|
+
else hook();
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
onReactivated
|
|
14
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ExcludePrefixKeys, Prefix } from './type';
|
|
2
|
+
/**
|
|
3
|
+
* 模块钩子
|
|
4
|
+
* 用于把相同的业务放入同一个模块中,可以避免命名冲突。模拟Setup的属性方式,支持多些生命周期
|
|
5
|
+
* 如示例所示
|
|
6
|
+
* - 命名:`levelTree.nodeCLick`的方式,而不是`levelTreeNodeClick`,这样有其他业务的树也可以使用`nodeCLick`,
|
|
7
|
+
* 如`userTree.nodeCLick`,避免名称困难
|
|
8
|
+
* - 生命周期:使用`[SetupLifeCycle.onMounted]`的方式来定义生命周期,可以在模块中写多个
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* const levelTree = useSetupModuleHooks({
|
|
12
|
+
* // region 获取数据
|
|
13
|
+
* treeData: ref(),
|
|
14
|
+
* getTreeData() {},
|
|
15
|
+
* [SetupLifeCycle.onMounted]() {
|
|
16
|
+
* levelTree.getTreeData()
|
|
17
|
+
* },
|
|
18
|
+
* // endregion
|
|
19
|
+
*
|
|
20
|
+
* // region 搜索
|
|
21
|
+
* searchQuery: ref(''),
|
|
22
|
+
* [SetupLifeCycle.onMounted]() {
|
|
23
|
+
* watch(levelTree.searchQuery, () => {})
|
|
24
|
+
* },
|
|
25
|
+
* // endregion
|
|
26
|
+
*
|
|
27
|
+
* // region 事件
|
|
28
|
+
* nodeCLick() {}
|
|
29
|
+
* // endregion
|
|
30
|
+
* })
|
|
31
|
+
* ```
|
|
32
|
+
* @param ops
|
|
33
|
+
*/
|
|
34
|
+
export declare function useSetupModuleHooks<T>(ops: T): ExcludePrefixKeys<T, Prefix>;
|
|
35
|
+
export declare const SetupLifeCycle: {
|
|
36
|
+
onMounted: Prefix;
|
|
37
|
+
onBeforeUnmount: Prefix;
|
|
38
|
+
onActivated: Prefix;
|
|
39
|
+
onDeactivated: Prefix;
|
|
40
|
+
onReactivated: Prefix;
|
|
41
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { onReactivated } from "../life-cycle/index.js";
|
|
2
|
+
import { onDeactivated, onActivated, onBeforeUnmount, onMounted } from "vue";
|
|
3
|
+
const lifeCycle = {
|
|
4
|
+
"onMounted": onMounted,
|
|
5
|
+
"onBeforeUnmount": onBeforeUnmount,
|
|
6
|
+
"onActivated": onActivated,
|
|
7
|
+
"onDeactivated": onDeactivated,
|
|
8
|
+
"onReactivated": onReactivated
|
|
9
|
+
};
|
|
10
|
+
function useSetupModuleHooks(ops) {
|
|
11
|
+
Object.keys(ops).forEach((key) => {
|
|
12
|
+
if (key.startsWith("_Module")) {
|
|
13
|
+
const keys = key.split("_");
|
|
14
|
+
if (lifeCycle[keys[2]] && typeof ops[key] === "function") {
|
|
15
|
+
lifeCycle[keys[2]](ops[key]);
|
|
16
|
+
}
|
|
17
|
+
delete ops[key];
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return ops;
|
|
22
|
+
}
|
|
23
|
+
let _Module_Index = 0;
|
|
24
|
+
const SetupLifeCycle = new Proxy({}, {
|
|
25
|
+
get(target, prop) {
|
|
26
|
+
if (_Module_Index >= Number.MAX_SAFE_INTEGER) _Module_Index = 0;
|
|
27
|
+
return `_Module_${prop.toString()}_${_Module_Index++}`;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export {
|
|
31
|
+
SetupLifeCycle,
|
|
32
|
+
useSetupModuleHooks
|
|
33
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,8 @@ import * as index$2 from "./directives/index.js";
|
|
|
3
3
|
import "./element-plus/index.js";
|
|
4
4
|
import { useTableSearchHooks } from "./hooks/table-search/index.js";
|
|
5
5
|
import { useInjectEventsHooks } from "./hooks/inject-events/index.js";
|
|
6
|
+
import { onReactivated } from "./hooks/life-cycle/index.js";
|
|
7
|
+
import { SetupLifeCycle, useSetupModuleHooks } from "./hooks/setup-module/index.js";
|
|
6
8
|
import { useEmptyHooks } from "./components/empty/hooks/index.js";
|
|
7
9
|
import { MatchUnit } from "./utils/match-unit/index.js";
|
|
8
10
|
import { TransitionFade } from "./utils/transition-fade/index.js";
|
|
@@ -74,6 +76,7 @@ export {
|
|
|
74
76
|
Pages,
|
|
75
77
|
PromiseUtil,
|
|
76
78
|
RejectError,
|
|
79
|
+
SetupLifeCycle,
|
|
77
80
|
TableUtil,
|
|
78
81
|
TransitionFade,
|
|
79
82
|
YsVideo,
|
|
@@ -88,6 +91,7 @@ export {
|
|
|
88
91
|
newAMapMarkerCluster,
|
|
89
92
|
numberRule,
|
|
90
93
|
numberTag,
|
|
94
|
+
onReactivated,
|
|
91
95
|
passwordRule,
|
|
92
96
|
passwordTag,
|
|
93
97
|
phoneRule,
|
|
@@ -112,6 +116,7 @@ export {
|
|
|
112
116
|
useElTableSortHooks,
|
|
113
117
|
useEmptyHooks,
|
|
114
118
|
useInjectEventsHooks,
|
|
119
|
+
useSetupModuleHooks,
|
|
115
120
|
useTableSearchHooks,
|
|
116
121
|
usernameRule,
|
|
117
122
|
usernameTag,
|
package/package.json
CHANGED
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"framework": "vue",
|
|
3
3
|
"name": "mrxy-yk",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.4.0",
|
|
5
5
|
"js-types-syntax": "typescript",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -753,7 +753,7 @@
|
|
|
753
753
|
"type": [
|
|
754
754
|
"boolean"
|
|
755
755
|
],
|
|
756
|
-
"description": "Dialog
|
|
756
|
+
"description": "Dialog右上角是否显示关闭按钮,缺省值为true"
|
|
757
757
|
}
|
|
758
758
|
],
|
|
759
759
|
"slots": [
|