matrix_components 2.0.305 → 2.0.306

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/README.md CHANGED
@@ -1,4 +1,11 @@
1
1
  # **组件库2.0**
2
+ ```
3
+ version:2.0.306
4
+ 2025年10月23日11:21:46
5
+ 更新日志:
6
+ 1.v-permission 按钮权限指令获取途径新增sessionStorage和provider
7
+ ```
8
+
2
9
 
3
10
  ```
4
11
  version:2.0.305
@@ -7239,10 +7239,30 @@ function registerDirective(app2) {
7239
7239
  });
7240
7240
  app2.directive("permission", {
7241
7241
  mounted(el, binding) {
7242
- var _a2, _b, _c;
7243
- const btnsPermission = inject("btnsPermission") || [];
7244
- const selector = ((_a2 = binding.modifiers) == null ? void 0 : _a2["class"]) ? "class" : ((_b = binding.modifiers) == null ? void 0 : _b["id"]) ? "id" : "id";
7245
- const isDisplayNone = (_c = binding.modifiers) == null ? void 0 : _c["display"];
7242
+ var _a2, _b, _c, _d, _e, _f;
7243
+ let btnsPermission = [];
7244
+ try {
7245
+ if (sessionStorage.getItem("btnsPermission")) {
7246
+ Array.isArray(JSON.parse(sessionStorage.getItem("btnsPermission"))) ? btnsPermission = JSON.parse(sessionStorage.getItem("btnsPermission")) : null;
7247
+ } else if (localStorage.getItem("btnsPermission")) {
7248
+ Array.isArray(JSON.parse(localStorage.getItem("btnsPermission"))) ? btnsPermission = JSON.parse(localStorage.getItem("btnsPermission")) : null;
7249
+ }
7250
+ } catch (e) {
7251
+ btnsPermission = [];
7252
+ }
7253
+ if (btnsPermission.length === 0) {
7254
+ if (app2.config.globalProperties.$btnsPermission) {
7255
+ btnsPermission = app2.config.globalProperties.$btnsPermission;
7256
+ } else if (binding.instance && binding.instance.$.appContext.app.config.globalProperties.$btnsPermission) {
7257
+ btnsPermission = binding.instance.$.appContext.app.config.globalProperties.$btnsPermission;
7258
+ } else if (binding.instance && ((_a2 = binding.instance.$.provides) == null ? void 0 : _a2.btnsPermission)) {
7259
+ btnsPermission = binding.instance.$.provides.btnsPermission;
7260
+ } else if (binding.instance && ((_c = (_b = binding.instance.$.parent) == null ? void 0 : _b.provides) == null ? void 0 : _c.btnsPermission)) {
7261
+ btnsPermission = binding.instance.$.parent.provides.btnsPermission;
7262
+ }
7263
+ }
7264
+ const selector = ((_d = binding.modifiers) == null ? void 0 : _d["class"]) ? "class" : ((_e = binding.modifiers) == null ? void 0 : _e["id"]) ? "id" : "id";
7265
+ const isDisplayNone = (_f = binding.modifiers) == null ? void 0 : _f["display"];
7246
7266
  if (selector === "id") {
7247
7267
  if (!(btnsPermission == null ? void 0 : btnsPermission.includes(el.getAttribute(selector)))) {
7248
7268
  if (isDisplayNone) {