@vue-spark/app-helpers 0.2.0 → 0.3.0
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/permission/index.js +2 -1
- package/package.json +17 -15
package/dist/permission/index.js
CHANGED
|
@@ -115,7 +115,8 @@ function createPermission(options = {}) {
|
|
|
115
115
|
const vPermission = { mounted(el, binding) {
|
|
116
116
|
const { value, arg, instance } = binding;
|
|
117
117
|
const permission = instance && instance.$permission;
|
|
118
|
-
if (!permission
|
|
118
|
+
if (!permission) throw new Error("`vPermission` directive must be used after `app.use(createPermission())`");
|
|
119
|
+
if (!permission.check(value, arg)) el.remove();
|
|
119
120
|
} };
|
|
120
121
|
|
|
121
122
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-spark/app-helpers",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
|
+
"packageManager": "pnpm@10.11.0",
|
|
5
6
|
"description": "Lightweight Helpers for Vue 3 Application Development.",
|
|
6
7
|
"author": "leihaohao <https://github.com/l246804>",
|
|
7
8
|
"license": "MIT",
|
|
@@ -32,6 +33,17 @@
|
|
|
32
33
|
"access": "public",
|
|
33
34
|
"registry": "https://registry.npmjs.org"
|
|
34
35
|
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"dev": "tsdown --watch",
|
|
38
|
+
"build": "tsdown",
|
|
39
|
+
"test": "vitest",
|
|
40
|
+
"typecheck": "tsc --noEmit",
|
|
41
|
+
"format": "prettier . --write --cache --cache-location ./node_modules/.cache/.prettier-cache",
|
|
42
|
+
"lint": "eslint . --cache --cache-location ./node_modules/.cache/.eslint-cache",
|
|
43
|
+
"lint:fix": "pnpm run lint --fix",
|
|
44
|
+
"release": "bumpp && pnpm publish",
|
|
45
|
+
"prepublishOnly": "pnpm run build"
|
|
46
|
+
},
|
|
35
47
|
"peerDependencies": {
|
|
36
48
|
"vue": "^3.5.0",
|
|
37
49
|
"vue-router": "^4.5.0"
|
|
@@ -44,8 +56,8 @@
|
|
|
44
56
|
"devDependencies": {
|
|
45
57
|
"@antfu/eslint-config": "^4.14.1",
|
|
46
58
|
"@sxzz/prettier-config": "^2.2.3",
|
|
47
|
-
"@tsconfig/
|
|
48
|
-
"@types/node": "^
|
|
59
|
+
"@tsconfig/node24": "^24.0.0",
|
|
60
|
+
"@types/node": "^24.10.0",
|
|
49
61
|
"@vue/tsconfig": "^0.7.0",
|
|
50
62
|
"bumpp": "^10.1.0",
|
|
51
63
|
"eslint": "^9.26.0",
|
|
@@ -57,21 +69,11 @@
|
|
|
57
69
|
"tsdown": "^0.11.9",
|
|
58
70
|
"tsx": "^4.19.4",
|
|
59
71
|
"typescript": "^5.8.3",
|
|
60
|
-
"vitest": "^
|
|
72
|
+
"vitest": "^4.0.3",
|
|
61
73
|
"vue": "^3.5.16",
|
|
62
74
|
"vue-router": "^4.5.1"
|
|
63
75
|
},
|
|
64
76
|
"simple-git-hooks": {
|
|
65
77
|
"pre-commit": "npx lint-staged"
|
|
66
|
-
},
|
|
67
|
-
"scripts": {
|
|
68
|
-
"dev": "tsdown --watch",
|
|
69
|
-
"build": "tsdown",
|
|
70
|
-
"test": "vitest",
|
|
71
|
-
"typecheck": "tsc --noEmit",
|
|
72
|
-
"format": "prettier . --write --cache --cache-location ./node_modules/.cache/.prettier-cache",
|
|
73
|
-
"lint": "eslint . --cache --cache-location ./node_modules/.cache/.eslint-cache",
|
|
74
|
-
"lint:fix": "pnpm run lint --fix",
|
|
75
|
-
"release": "bumpp && pnpm publish"
|
|
76
78
|
}
|
|
77
|
-
}
|
|
79
|
+
}
|