@hzwtech.com/utils 0.0.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/.eslintrc-auto-import.json +103 -0
- package/.vscode/extensions.json +12 -0
- package/.vscode/html.code-snippets +25 -0
- package/.vscode/scss.code-snippets +77 -0
- package/.vscode/settings.json +102 -0
- package/.vscode/tailwind.json +56 -0
- package/.vscode/typescript.code-snippets +162 -0
- package/.vscode/vue.code-snippets +40 -0
- package/LICENSE +21 -0
- package/dist/eslint.d.ts +6 -0
- package/dist/eslint.js +43 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +3 -0
- package/dist/styles/_classes.scss +80 -0
- package/dist/styles/_reset.scss +111 -0
- package/dist/styles/index.css +4927 -0
- package/dist/styles/index.css.map +1 -0
- package/dist/styles/index.scss +2 -0
- package/dist/styles/reference/_config.scss +209 -0
- package/dist/styles/reference/_functions.scss +17 -0
- package/dist/styles/reference/_index.scss +3 -0
- package/dist/styles/reference/_mixins.scss +209 -0
- package/dist/ts/bem.d.ts +38 -0
- package/dist/ts/config.d.ts +13 -0
- package/dist/ts/reg.d.ts +17 -0
- package/dist/ts/request.d.ts +51 -0
- package/dist/ts/utils.d.ts +128 -0
- package/dist/ts/validators.d.ts +29 -0
- package/dist/types/global.d.ts +188 -0
- package/dist/types/index.d.ts +24 -0
- package/dist/types/window.d.ts +13 -0
- package/dist/vite.d.ts +30 -0
- package/dist/vite.js +42 -0
- package/eslint.config.mjs +3 -0
- package/index.html +12 -0
- package/package.json +59 -0
- package/readme.md +114 -0
- package/rollup.config.mjs +28 -0
- package/tsconfig.json +19 -0
- package/vite.config.mts +38 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"globals": {
|
|
3
|
+
"ApiRequest": "writable",
|
|
4
|
+
"Component": "writable",
|
|
5
|
+
"ComponentPublicInstance": "writable",
|
|
6
|
+
"ComputedRef": "writable",
|
|
7
|
+
"DirectiveBinding": "writable",
|
|
8
|
+
"EffectScope": "writable",
|
|
9
|
+
"ExtractDefaultPropTypes": "writable",
|
|
10
|
+
"ExtractPropTypes": "writable",
|
|
11
|
+
"ExtractPublicPropTypes": "writable",
|
|
12
|
+
"GConfig": "writable",
|
|
13
|
+
"IBem": "writable",
|
|
14
|
+
"IBemCss": "writable",
|
|
15
|
+
"IRequestConfig": "writable",
|
|
16
|
+
"InjectionKey": "writable",
|
|
17
|
+
"MaybeRef": "writable",
|
|
18
|
+
"MaybeRefOrGetter": "writable",
|
|
19
|
+
"PropType": "writable",
|
|
20
|
+
"Ref": "writable",
|
|
21
|
+
"ShallowRef": "writable",
|
|
22
|
+
"Slot": "writable",
|
|
23
|
+
"Slots": "writable",
|
|
24
|
+
"VNode": "writable",
|
|
25
|
+
"WritableComputedRef": "writable",
|
|
26
|
+
"acceptHMRUpdate": "writable",
|
|
27
|
+
"bem": "writable",
|
|
28
|
+
"computed": "writable",
|
|
29
|
+
"config": "writable",
|
|
30
|
+
"createApp": "writable",
|
|
31
|
+
"createPinia": "writable",
|
|
32
|
+
"css": "writable",
|
|
33
|
+
"customRef": "writable",
|
|
34
|
+
"defineAsyncComponent": "writable",
|
|
35
|
+
"defineComponent": "writable",
|
|
36
|
+
"defineStore": "writable",
|
|
37
|
+
"effectScope": "writable",
|
|
38
|
+
"getActivePinia": "writable",
|
|
39
|
+
"getCurrentInstance": "writable",
|
|
40
|
+
"getCurrentScope": "writable",
|
|
41
|
+
"getCurrentWatcher": "writable",
|
|
42
|
+
"h": "writable",
|
|
43
|
+
"inject": "writable",
|
|
44
|
+
"isProxy": "writable",
|
|
45
|
+
"isReactive": "writable",
|
|
46
|
+
"isReadonly": "writable",
|
|
47
|
+
"isRef": "writable",
|
|
48
|
+
"isShallow": "writable",
|
|
49
|
+
"mapActions": "writable",
|
|
50
|
+
"mapGetters": "writable",
|
|
51
|
+
"mapState": "writable",
|
|
52
|
+
"mapStores": "writable",
|
|
53
|
+
"mapWritableState": "writable",
|
|
54
|
+
"markRaw": "writable",
|
|
55
|
+
"nextTick": "writable",
|
|
56
|
+
"onActivated": "writable",
|
|
57
|
+
"onBeforeMount": "writable",
|
|
58
|
+
"onBeforeUnmount": "writable",
|
|
59
|
+
"onBeforeUpdate": "writable",
|
|
60
|
+
"onDeactivated": "writable",
|
|
61
|
+
"onErrorCaptured": "writable",
|
|
62
|
+
"onMounted": "writable",
|
|
63
|
+
"onRenderTracked": "writable",
|
|
64
|
+
"onRenderTriggered": "writable",
|
|
65
|
+
"onScopeDispose": "writable",
|
|
66
|
+
"onServerPrefetch": "writable",
|
|
67
|
+
"onUnmounted": "writable",
|
|
68
|
+
"onUpdated": "writable",
|
|
69
|
+
"onWatcherCleanup": "writable",
|
|
70
|
+
"provide": "writable",
|
|
71
|
+
"reactive": "writable",
|
|
72
|
+
"readonly": "writable",
|
|
73
|
+
"ref": "writable",
|
|
74
|
+
"reg": "writable",
|
|
75
|
+
"request": "writable",
|
|
76
|
+
"resolveComponent": "writable",
|
|
77
|
+
"setActivePinia": "writable",
|
|
78
|
+
"setMapStoreSuffix": "writable",
|
|
79
|
+
"shallowReactive": "writable",
|
|
80
|
+
"shallowReadonly": "writable",
|
|
81
|
+
"shallowRef": "writable",
|
|
82
|
+
"storeToRefs": "writable",
|
|
83
|
+
"toRaw": "writable",
|
|
84
|
+
"toRef": "writable",
|
|
85
|
+
"toRefs": "writable",
|
|
86
|
+
"toValue": "writable",
|
|
87
|
+
"triggerRef": "writable",
|
|
88
|
+
"unref": "writable",
|
|
89
|
+
"useAttrs": "writable",
|
|
90
|
+
"useCssModule": "writable",
|
|
91
|
+
"useCssVars": "writable",
|
|
92
|
+
"useId": "writable",
|
|
93
|
+
"useModel": "writable",
|
|
94
|
+
"useSlots": "writable",
|
|
95
|
+
"useTemplateRef": "writable",
|
|
96
|
+
"utils": "writable",
|
|
97
|
+
"validators": "writable",
|
|
98
|
+
"watch": "writable",
|
|
99
|
+
"watchEffect": "writable",
|
|
100
|
+
"watchPostEffect": "writable",
|
|
101
|
+
"watchSyncEffect": "writable"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"recommendations": [
|
|
3
|
+
"dbaeumer.vscode-eslint",
|
|
4
|
+
"stylelint.vscode-stylelint",
|
|
5
|
+
"streetsidesoftware.code-spell-checker",
|
|
6
|
+
"bradlc.vscode-tailwindcss",
|
|
7
|
+
"vue.volar",
|
|
8
|
+
"ms-ceintl.vscode-language-pack-zh-hans",
|
|
9
|
+
"alibaba-cloud.tongyi-lingma",
|
|
10
|
+
"esbenp.prettier-vscode"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Place your snippets for html here. Each snippet is defined under a snippet name and has a prefix, body and
|
|
3
|
+
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
|
|
4
|
+
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
|
|
5
|
+
// same ids are connected.
|
|
6
|
+
// Example:
|
|
7
|
+
// "Print to console": {
|
|
8
|
+
// "prefix": "log",
|
|
9
|
+
// "body": [
|
|
10
|
+
// "console.log('$1');",
|
|
11
|
+
// "$2"
|
|
12
|
+
// ],
|
|
13
|
+
// "description": "Log output to console"
|
|
14
|
+
// }
|
|
15
|
+
"module-comment-template": {
|
|
16
|
+
"prefix": "mc",
|
|
17
|
+
"description": "模块化注释module comment",
|
|
18
|
+
"body": ["<!-- ######## ${1:模块}[START] ######## -->", "<!-- ######## ${1:模块}[E N D] ######## -->"],
|
|
19
|
+
},
|
|
20
|
+
"vue-class": {
|
|
21
|
+
"prefix": ":c",
|
|
22
|
+
"description": ":class,列表形式传入class样式名",
|
|
23
|
+
"body": [":class=\"[${1}]\""],
|
|
24
|
+
},
|
|
25
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Place your snippets for scss here. Each snippet is defined under a snippet name and has a prefix, body and
|
|
3
|
+
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
|
|
4
|
+
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
|
|
5
|
+
// same ids are connected.
|
|
6
|
+
// Example:
|
|
7
|
+
// "Print to console": {
|
|
8
|
+
// "prefix": "log",
|
|
9
|
+
// "body": [
|
|
10
|
+
// "console.log('$1');",
|
|
11
|
+
// "$2"
|
|
12
|
+
// ],
|
|
13
|
+
// "description": "Log output to console"
|
|
14
|
+
// }
|
|
15
|
+
"scss-css-bem": {
|
|
16
|
+
"prefix": "cem",
|
|
17
|
+
"description": "css bem",
|
|
18
|
+
"body": ["@include mx-css-bem($$block,${1:element},${2:modifier}){", "}"],
|
|
19
|
+
},
|
|
20
|
+
"scss-css-bm": {
|
|
21
|
+
"prefix": "cm",
|
|
22
|
+
"description": "css bm",
|
|
23
|
+
"body": ["@include mx-css-bm($$block,${1:modifier}){", "}"],
|
|
24
|
+
},
|
|
25
|
+
"scss-css-be": {
|
|
26
|
+
"prefix": "ce",
|
|
27
|
+
"description": "css be",
|
|
28
|
+
"body": ["@include mx-css-be($$block,${1:element}){", "}"],
|
|
29
|
+
},
|
|
30
|
+
"scss-css-b": {
|
|
31
|
+
"prefix": "cb",
|
|
32
|
+
"description": "css b",
|
|
33
|
+
"body": ["@include mx-css-b($$block){", "}"],
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
"scss-app-em": {
|
|
37
|
+
"prefix": "aem",
|
|
38
|
+
"description": "app bem",
|
|
39
|
+
"body": ["@include mx-app-bem($$block,${1:element},${2:modifier}){", "}"],
|
|
40
|
+
},
|
|
41
|
+
"scss-app-m": {
|
|
42
|
+
"prefix": "am",
|
|
43
|
+
"description": "app bm",
|
|
44
|
+
"body": ["@include mx-app-bm($$block,${1:modifier}){", "}"],
|
|
45
|
+
},
|
|
46
|
+
"scss-app-e": {
|
|
47
|
+
"prefix": "ae",
|
|
48
|
+
"description": "app be",
|
|
49
|
+
"body": ["@include mx-app-be($$block,${1:element}){", "}"],
|
|
50
|
+
},
|
|
51
|
+
"scss-app-b": {
|
|
52
|
+
"prefix": "ab",
|
|
53
|
+
"description": "app b",
|
|
54
|
+
"body": ["$$block:${1};", "@include mx-app-b($$block){", "}"],
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
"scss-hzw-em": {
|
|
58
|
+
"prefix": "hem",
|
|
59
|
+
"description": "hzw bem",
|
|
60
|
+
"body": ["@include mx-hzw-bem($$block,${1:element},${2:modifier}){", "}"],
|
|
61
|
+
},
|
|
62
|
+
"scss-hzw-m": {
|
|
63
|
+
"prefix": "hm",
|
|
64
|
+
"description": "hzw bm",
|
|
65
|
+
"body": ["@include mx-hzw-bm($$block,${1:modifier}){", "}"],
|
|
66
|
+
},
|
|
67
|
+
"scss-hzw-e": {
|
|
68
|
+
"prefix": "he",
|
|
69
|
+
"description": "hzw be",
|
|
70
|
+
"body": ["@include mx-hzw-be($$block,${1:element}){", "}"],
|
|
71
|
+
},
|
|
72
|
+
"scss-hzw-b": {
|
|
73
|
+
"prefix": "hb",
|
|
74
|
+
"description": "hzw b",
|
|
75
|
+
"body": ["$$block:${1};", "@include mx-hzw-b($$block){", "}"],
|
|
76
|
+
},
|
|
77
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Disable the default formatter, use eslint instead
|
|
3
|
+
"prettier.enable": false,
|
|
4
|
+
// 开启保存时自动修复
|
|
5
|
+
"editor.codeActionsOnSave": {
|
|
6
|
+
"source.fixAll.eslint": "explicit",
|
|
7
|
+
"source.fixAll.stylelint": "explicit"
|
|
8
|
+
},
|
|
9
|
+
// prettier:保存时自动格式化所有支持文件:javascript/javascriptreact/typescript/typescriptreact/json/graphql
|
|
10
|
+
"editor.formatOnSave": true,
|
|
11
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
12
|
+
// https://github.com/tailwindlabs/tailwindcss/discussions/5258
|
|
13
|
+
"css.customData": [".vscode/tailwind.json"],
|
|
14
|
+
"tailwindCSS.experimental.classRegex": [
|
|
15
|
+
// https://github.com/lukeed/clsx?tab=readme-ov-file#tailwind-support
|
|
16
|
+
["clsx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"],
|
|
17
|
+
// https://cva.style/docs/getting-started/installation
|
|
18
|
+
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
|
|
19
|
+
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
|
|
20
|
+
],
|
|
21
|
+
// Silent the stylistic rules in you IDE, but still auto fix them
|
|
22
|
+
"eslint.rules.customizations": [
|
|
23
|
+
{
|
|
24
|
+
"rule": "style/*",
|
|
25
|
+
"severity": "off"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"rule": "format/*",
|
|
29
|
+
"severity": "off"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"rule": "*-indent",
|
|
33
|
+
"severity": "off"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"rule": "*-spacing",
|
|
37
|
+
"severity": "off"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"rule": "*-spaces",
|
|
41
|
+
"severity": "off"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"rule": "*-order",
|
|
45
|
+
"severity": "off"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"rule": "*-dangle",
|
|
49
|
+
"severity": "off"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"rule": "*-newline",
|
|
53
|
+
"severity": "off"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"rule": "*quotes",
|
|
57
|
+
"severity": "off"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"rule": "*semi",
|
|
61
|
+
"severity": "off"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
// Enable eslint for all supported languages
|
|
65
|
+
"eslint.validate": [
|
|
66
|
+
"javascript",
|
|
67
|
+
"javascriptreact",
|
|
68
|
+
"typescript",
|
|
69
|
+
"typescriptreact",
|
|
70
|
+
"vue",
|
|
71
|
+
"html",
|
|
72
|
+
"markdown",
|
|
73
|
+
"json",
|
|
74
|
+
"jsonc",
|
|
75
|
+
"yaml",
|
|
76
|
+
"toml",
|
|
77
|
+
"xml",
|
|
78
|
+
"gql",
|
|
79
|
+
"graphql",
|
|
80
|
+
"astro",
|
|
81
|
+
"css",
|
|
82
|
+
"less",
|
|
83
|
+
"scss",
|
|
84
|
+
"pcss",
|
|
85
|
+
"postcss"
|
|
86
|
+
],
|
|
87
|
+
"css.validate": false,
|
|
88
|
+
"less.validate": false,
|
|
89
|
+
"scss.validate": false,
|
|
90
|
+
"stylelint.validate": ["vue", "css", "scss"],
|
|
91
|
+
"cSpell.words": ["dcloudio", "easyinput", "qrcode", "unplugin", "weapp", "weixin"],
|
|
92
|
+
"[typescript]": {
|
|
93
|
+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
|
94
|
+
},
|
|
95
|
+
"oxc.enable": true,
|
|
96
|
+
"[javascript]": {
|
|
97
|
+
"editor.defaultFormatter": "vscode.typescript-language-features"
|
|
98
|
+
},
|
|
99
|
+
"[vue]": {
|
|
100
|
+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// https://github.com/tailwindlabs/tailwindcss/discussions/5258
|
|
2
|
+
{
|
|
3
|
+
"version": 1.1,
|
|
4
|
+
"atDirectives": [
|
|
5
|
+
{
|
|
6
|
+
"name": "@tailwind",
|
|
7
|
+
"description": "Use the `@tailwind` directive to insert Tailwind's `base`, `components`, `utilities` and `screens` styles into your CSS.",
|
|
8
|
+
"references": [
|
|
9
|
+
{
|
|
10
|
+
"name": "Tailwind Documentation",
|
|
11
|
+
"url": "https://tailwindcss.com/docs/functions-and-directives#tailwind"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "@apply",
|
|
17
|
+
"description": "Use the `@apply` directive to inline any existing utility classes into your own custom CSS. This is useful when you find a common utility pattern in your HTML that you’d like to extract to a new component.",
|
|
18
|
+
"references": [
|
|
19
|
+
{
|
|
20
|
+
"name": "Tailwind Documentation",
|
|
21
|
+
"url": "https://tailwindcss.com/docs/functions-and-directives#apply"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "@responsive",
|
|
27
|
+
"description": "You can generate responsive variants of your own classes by wrapping their definitions in the `@responsive` directive:\n```css\n@responsive {\n .alert {\n background-color: #E53E3E;\n }\n}\n```\n",
|
|
28
|
+
"references": [
|
|
29
|
+
{
|
|
30
|
+
"name": "Tailwind Documentation",
|
|
31
|
+
"url": "https://tailwindcss.com/docs/functions-and-directives#responsive"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "@screen",
|
|
37
|
+
"description": "The `@screen` directive allows you to create media queries that reference your breakpoints by **name** instead of duplicating their values in your own CSS:\n```css\n@screen sm {\n /* ... */\n}\n```\n…gets transformed into this:\n```css\n@media (min-width: 640px) {\n /* ... */\n}\n```\n",
|
|
38
|
+
"references": [
|
|
39
|
+
{
|
|
40
|
+
"name": "Tailwind Documentation",
|
|
41
|
+
"url": "https://tailwindcss.com/docs/functions-and-directives#screen"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "@variants",
|
|
47
|
+
"description": "Generate `hover`, `focus`, `active` and other **variants** of your own utilities by wrapping their definitions in the `@variants` directive:\n```css\n@variants hover, focus {\n .btn-brand {\n background-color: #3182CE;\n }\n}\n```\n",
|
|
48
|
+
"references": [
|
|
49
|
+
{
|
|
50
|
+
"name": "Tailwind Documentation",
|
|
51
|
+
"url": "https://tailwindcss.com/docs/functions-and-directives#variants"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
{
|
|
2
|
+
"module-comment-template": {
|
|
3
|
+
"prefix": "mc",
|
|
4
|
+
"description": "ts模块化注释module comment",
|
|
5
|
+
"body": [
|
|
6
|
+
"//-------------${1:模块}[START]-------------//",
|
|
7
|
+
"//-------------${1:模块}[E N D]-------------//"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
"Print to console": {
|
|
11
|
+
"prefix": "log",
|
|
12
|
+
"body": ["console.log('${1}');"],
|
|
13
|
+
"description": "Log output to console"
|
|
14
|
+
},
|
|
15
|
+
"css-bem": {
|
|
16
|
+
"prefix": "cem",
|
|
17
|
+
"description": "css bem",
|
|
18
|
+
"body": ["css.bem('${1:block}','${2:element}','${3:modifier}')"]
|
|
19
|
+
},
|
|
20
|
+
"css-bm": {
|
|
21
|
+
"prefix": "cm",
|
|
22
|
+
"description": "css bm",
|
|
23
|
+
"body": ["css.bm('${1:block}','${2:modifier}')"]
|
|
24
|
+
},
|
|
25
|
+
"css-be": {
|
|
26
|
+
"prefix": "ce",
|
|
27
|
+
"description": "css be",
|
|
28
|
+
"body": ["css.be('${1:block}','${2:element}')"]
|
|
29
|
+
},
|
|
30
|
+
"css-b": {
|
|
31
|
+
"prefix": "cb",
|
|
32
|
+
"description": "css b",
|
|
33
|
+
"body": ["css.b('${1:block}')"]
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
"app-em": {
|
|
37
|
+
"prefix": "aem",
|
|
38
|
+
"description": "app bem",
|
|
39
|
+
"body": ["app.em('${1:element}','${2:modifier}')"]
|
|
40
|
+
},
|
|
41
|
+
"app-m": {
|
|
42
|
+
"prefix": "am",
|
|
43
|
+
"description": "app bm",
|
|
44
|
+
"body": ["app.m('${1:modifier}')"]
|
|
45
|
+
},
|
|
46
|
+
"app-e": {
|
|
47
|
+
"prefix": "ae",
|
|
48
|
+
"description": "app be",
|
|
49
|
+
"body": ["app.e('${1:element}')"]
|
|
50
|
+
},
|
|
51
|
+
"app-b": {
|
|
52
|
+
"prefix": "ab",
|
|
53
|
+
"description": "app b",
|
|
54
|
+
"body": ["app.b()"]
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
"hzw-em": {
|
|
58
|
+
"prefix": "hem",
|
|
59
|
+
"description": "hzw bem",
|
|
60
|
+
"body": ["hzw.em('${1:element}','${2:modifier}')"]
|
|
61
|
+
},
|
|
62
|
+
"hzw-m": {
|
|
63
|
+
"prefix": "hm",
|
|
64
|
+
"description": "hzw bm",
|
|
65
|
+
"body": ["hzw.m('${1:modifier}')"]
|
|
66
|
+
},
|
|
67
|
+
"hzw-e": {
|
|
68
|
+
"prefix": "he",
|
|
69
|
+
"description": "hzw be",
|
|
70
|
+
"body": ["hzw.e('${1:element}')"]
|
|
71
|
+
},
|
|
72
|
+
"hzw-b": {
|
|
73
|
+
"prefix": "hb",
|
|
74
|
+
"description": "hzw b",
|
|
75
|
+
"body": ["hzw.b()"]
|
|
76
|
+
},
|
|
77
|
+
"useBem":{
|
|
78
|
+
"prefix": "bem",
|
|
79
|
+
"body": [
|
|
80
|
+
"import bem from '@/hooks/useBem';"
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
"utils":{
|
|
84
|
+
"prefix": "ut",
|
|
85
|
+
"body": [
|
|
86
|
+
"import * as utils from '@/utils';"
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
"useStore":{
|
|
90
|
+
"prefix":"sto",
|
|
91
|
+
"body":[
|
|
92
|
+
"import { useStore } from 'vuex';",
|
|
93
|
+
"const store = useStore();"
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
"useRoute":{
|
|
97
|
+
"prefix":"rte",
|
|
98
|
+
"body":[
|
|
99
|
+
"import { useRoute } from 'vue-router';",
|
|
100
|
+
"const route = useRoute();"
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
"useRouter":{
|
|
104
|
+
"prefix":"rtr",
|
|
105
|
+
"body":[
|
|
106
|
+
"import { useRouter } from 'vue-router';",
|
|
107
|
+
"const router = useRouter();"
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
"vuex-module":{
|
|
111
|
+
"prefix":"mod",
|
|
112
|
+
"body":[
|
|
113
|
+
"import { Module } from 'vuex';",
|
|
114
|
+
"interface IState {",
|
|
115
|
+
"}",
|
|
116
|
+
"const module: Module<IState, IGlobalState> = {",
|
|
117
|
+
" namespaced: true,",
|
|
118
|
+
" state: {},",
|
|
119
|
+
" mutations: {",
|
|
120
|
+
" ${1}(state: IState, payload: any) {",
|
|
121
|
+
" },",
|
|
122
|
+
" },",
|
|
123
|
+
"};",
|
|
124
|
+
"export default module;"
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
"icon": {
|
|
128
|
+
"prefix": "icon",
|
|
129
|
+
"description": "antd icon",
|
|
130
|
+
"body": ["import { DeleteOutlined, SearchOutlined } from '@ant-design/icons';"]
|
|
131
|
+
},
|
|
132
|
+
"useState": {
|
|
133
|
+
"prefix": "us",
|
|
134
|
+
"description": "useState",
|
|
135
|
+
"body": ["const [state${1:Name}, setState${1:Name}] = useState<${2:any}>($3);"]
|
|
136
|
+
},
|
|
137
|
+
"useNavigate": {
|
|
138
|
+
"prefix": "nav",
|
|
139
|
+
"description": "useNavigate",
|
|
140
|
+
"body": ["const navigate = useNavigate();"]
|
|
141
|
+
},
|
|
142
|
+
"map": {
|
|
143
|
+
"prefix": "map",
|
|
144
|
+
"description": "mapDispatchToProps,mapModelToProps",
|
|
145
|
+
"body": [
|
|
146
|
+
"const mapDispatchToProps = (dispatch: any) => {",
|
|
147
|
+
"return {",
|
|
148
|
+
" $2: () =>",
|
|
149
|
+
" dispatch({",
|
|
150
|
+
" type: '$1/$2',",
|
|
151
|
+
" }),",
|
|
152
|
+
" };",
|
|
153
|
+
"};",
|
|
154
|
+
"const mapModelToProps = (allModels: any) => {",
|
|
155
|
+
" return {",
|
|
156
|
+
" dialog: allModels.$1,",
|
|
157
|
+
" };",
|
|
158
|
+
"};",
|
|
159
|
+
"export default connect(mapModelToProps, mapDispatchToProps)(App);"
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scope": "vue",
|
|
3
|
+
"console": {
|
|
4
|
+
"prefix": "log",
|
|
5
|
+
"body": ["console.log('${1}');"],
|
|
6
|
+
"description": "Log output to console123",
|
|
7
|
+
},
|
|
8
|
+
"app-uni": {
|
|
9
|
+
"prefix": "app-uni",
|
|
10
|
+
"body": [
|
|
11
|
+
"<template>",
|
|
12
|
+
" <view :class=\"[app.b()]\">$1</view>",
|
|
13
|
+
"</template>",
|
|
14
|
+
"",
|
|
15
|
+
"<script lang='ts' setup>",
|
|
16
|
+
"const app = bem.app('$1');",
|
|
17
|
+
"</script>",
|
|
18
|
+
"",
|
|
19
|
+
"<style lang='scss' scoped>",
|
|
20
|
+
"</style>",
|
|
21
|
+
],
|
|
22
|
+
"description": "创建vue3 uni-app的app页面",
|
|
23
|
+
},
|
|
24
|
+
"hzw-uni": {
|
|
25
|
+
"prefix": "hzw-uni",
|
|
26
|
+
"body": [
|
|
27
|
+
"<template>",
|
|
28
|
+
" <view :class=\"[hzw.b()]\">$1</view>",
|
|
29
|
+
"</template>",
|
|
30
|
+
"",
|
|
31
|
+
"<script lang='ts' setup>",
|
|
32
|
+
"const hzw = bem.hzw('$1');",
|
|
33
|
+
"</script>",
|
|
34
|
+
"",
|
|
35
|
+
"<style lang='scss' scoped>",
|
|
36
|
+
"</style>",
|
|
37
|
+
],
|
|
38
|
+
"description": "创建vue3 uni-app的hzw页面",
|
|
39
|
+
},
|
|
40
|
+
}
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 hzwtech.com
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/eslint.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { OptionsConfig } from '@antfu/eslint-config'
|
|
2
|
+
import type { Linter } from 'eslint'
|
|
3
|
+
import type { FlatConfigComposer } from 'eslint-flat-config-utils'
|
|
4
|
+
|
|
5
|
+
declare function eslint(options: OptionsConfig & Linter.Config): FlatConfigComposer<Linter.Config, string>
|
|
6
|
+
export default eslint
|
package/dist/eslint.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { antfu } from '@antfu/eslint-config'
|
|
2
|
+
function eslint(options) {
|
|
3
|
+
return antfu({
|
|
4
|
+
formatters: true,
|
|
5
|
+
vue: {
|
|
6
|
+
overrides: {
|
|
7
|
+
'vue/component-definition-name-casing': ['error', 'kebab-case'],
|
|
8
|
+
'vue/component-name-in-template-casing': ['error', 'kebab-case'],
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
rules: {
|
|
12
|
+
'style/brace-style': ['error', '1tbs'],
|
|
13
|
+
},
|
|
14
|
+
ignores: [
|
|
15
|
+
// 依赖与构建产物
|
|
16
|
+
'**/node_modules',
|
|
17
|
+
'**/dist',
|
|
18
|
+
'**/package-lock.json',
|
|
19
|
+
// 缓存与临时文件
|
|
20
|
+
'**/.cache',
|
|
21
|
+
'**/.temp',
|
|
22
|
+
'**/tmp',
|
|
23
|
+
// 框架生成文件
|
|
24
|
+
'**/.nuxt',
|
|
25
|
+
'**/.next',
|
|
26
|
+
'**/.svelte-kit',
|
|
27
|
+
// 编辑器配置
|
|
28
|
+
'**/.idea',
|
|
29
|
+
'**/.vscode/cache',
|
|
30
|
+
// 日志与文档
|
|
31
|
+
'**/CHANGELOG*.md',
|
|
32
|
+
'**/LICENSE*',
|
|
33
|
+
// 测试快照
|
|
34
|
+
'**/__snapshots__',
|
|
35
|
+
// 自动生成的类型文件
|
|
36
|
+
'**/auto-import?(s).d.ts',
|
|
37
|
+
'**/components.d.ts',
|
|
38
|
+
],
|
|
39
|
+
...options,
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default eslint
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { App } from 'vue';
|
|
2
|
+
import type { GConfig } from './ts/config';
|
|
3
|
+
export * from './ts/bem';
|
|
4
|
+
export * from './ts/reg';
|
|
5
|
+
export * from './ts/request';
|
|
6
|
+
export * from './ts/utils';
|
|
7
|
+
export * from './ts/validators';
|
|
8
|
+
declare function install(vue: App<Element>, cfg?: Partial<GConfig>): void;
|
|
9
|
+
export declare function init(cfg?: Partial<GConfig>): void;
|
|
10
|
+
declare const _default: {
|
|
11
|
+
install: typeof install;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|