@vft/directives 0.0.12 → 0.0.14

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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@vft/use");function u(e,i,t){var n;const{hasPermission:s}=o.usePermission(t||[]),r=i.value;r&&(s(r)||(n=e.parentNode)==null||n.removeChild(e))}function c(e,i){e.directive("auth",{mounted:(t,s)=>{u(t,s,i)}})}exports.setupPermissionDirective=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@vft/use"),o=require("vue");function c(e,i,t){var u;const{hasPermission:r}=n.usePermission(t||o.ref([])),s=i.value;s&&(r(s)||(u=e.parentNode)==null||u.removeChild(e))}function v(e,i){e.directive("auth",{mounted:(t,r)=>{c(t,r,i)}})}exports.setupPermissionDirective=v;
@@ -1,16 +1,17 @@
1
1
  import { usePermission as s } from "@vft/use";
2
- function u(e, i, t) {
3
- var r;
4
- const { hasPermission: o } = s(t || []), n = i.value;
5
- n && (o(n) || (r = e.parentNode) == null || r.removeChild(e));
2
+ import { ref as u } from "vue";
3
+ function m(e, i, o) {
4
+ var n;
5
+ const { hasPermission: r } = s(o || u([])), t = i.value;
6
+ t && (r(t) || (n = e.parentNode) == null || n.removeChild(e));
6
7
  }
7
- function c(e, i) {
8
+ function a(e, i) {
8
9
  e.directive("auth", {
9
- mounted: (t, o) => {
10
- u(t, o, i);
10
+ mounted: (o, r) => {
11
+ m(o, r, i);
11
12
  }
12
13
  });
13
14
  }
14
15
  export {
15
- c as setupPermissionDirective
16
+ a as setupPermissionDirective
16
17
  };
@@ -1,2 +1,2 @@
1
- import type { App, Ref } from 'vue';
1
+ import { type App, type Ref } from 'vue';
2
2
  export declare function setupPermissionDirective(app: App, roleList: Ref<string[]>): void;
@@ -1,9 +1,3 @@
1
1
  import type { Directive } from 'vue';
2
- /**
3
- * @description 禁止 ios 橡皮筋效果
4
- * @author wfd
5
- * @date 2022/8/24 15:40
6
- * @example v-scroll-fix
7
- */
8
2
  declare const ScrollFix: Directive;
9
3
  export default ScrollFix;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vft/directives",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "main": "./dist/cjs/index.cjs",
5
5
  "module": "./dist/es/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -14,15 +14,15 @@
14
14
  "dist"
15
15
  ],
16
16
  "devDependencies": {
17
- "@vft/use": "0.0.18",
18
- "@vft/utils": "0.0.27"
17
+ "@vft/use": "0.0.20",
18
+ "@vft/utils": "0.0.30"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "vue": ">=3.2.0"
22
22
  },
23
23
  "scripts": {
24
24
  "stub-unbuild": "unbuild --stub && pnpm -F @vft/scripts stub-helper",
25
- "dev": "tsup --config ../../common/cjs-utils/src/tsup.config.ts",
25
+ "dev": "tsup --config ../../common/cjs-utils/src/tsup.config.ts && tsx ../../scripts/build/src/ts-dev-migrate.ts",
26
26
  "clean": "pnpm /^clean:/",
27
27
  "clean:dist": "rimraf dist",
28
28
  "clean:node_modules": "rimraf node_modules",