@xysfe/admin-menu 2.4.0-beta.5 → 2.4.0-beta.6

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.
@@ -19898,10 +19898,35 @@ var state_createStore = function createStore() {
19898
19898
  return parseInt(item.wxDepartmentid) === parseInt(id);
19899
19899
  }) !== -1;
19900
19900
  };
19901
+ var createAuthDirective = function createAuthDirective() {
19902
+ return {
19903
+ name: 'auth',
19904
+ bind: function bind(el, _ref2) {
19905
+ var value = _ref2.value;
19906
+ if (el.style.display) {
19907
+ // 缓存本身的display
19908
+ el.dataset.display = el.style.display;
19909
+ }
19910
+ el.style.display = 'none';
19911
+ var isHas = auth(value);
19912
+ if (!isHas) {
19913
+ el.parentNode && el.parentNode.removeChild(el);
19914
+ } else {
19915
+ if (el.dataset.display) {
19916
+ // 还原原来的display
19917
+ el.style.display = el.dataset.display;
19918
+ } else {
19919
+ el.style.display = '';
19920
+ }
19921
+ }
19922
+ }
19923
+ };
19924
+ };
19901
19925
  return {
19902
19926
  handleRoute: handleRoute,
19903
19927
  auth: auth,
19904
- isInDepartment: isInDepartment
19928
+ isInDepartment: isInDepartment,
19929
+ createAuthDirective: createAuthDirective
19905
19930
  };
19906
19931
  });
19907
19932
  // CONCATENATED MODULE: ./src/store/index.js
@@ -19916,7 +19941,6 @@ var common = __webpack_require__("7dd0");
19916
19941
 
19917
19942
 
19918
19943
 
19919
- // import authDirective from './util/authDirective'
19920
19944
 
19921
19945
  var baseOptions = {
19922
19946
  router: null,
@@ -19933,18 +19957,17 @@ function usePlugin() {
19933
19957
  var _usePermit = store_permit(options),
19934
19958
  auth = _usePermit.auth,
19935
19959
  handleRoute = _usePermit.handleRoute,
19936
- isInDepartment = _usePermit.isInDepartment;
19937
- var _createStore = state_createStore(options),
19938
- state = _createStore.state;
19960
+ isInDepartment = _usePermit.isInDepartment,
19961
+ createAuthDirective = _usePermit.createAuthDirective;
19962
+ var authDirective = createAuthDirective();
19939
19963
  Container.install = function (Vue) {
19940
19964
  handleRoute();
19941
19965
  Vue.component(Container.name, Container);
19942
- // Vue.directive(authDirective.name, authDirective)
19966
+ Vue.directive(authDirective.name, authDirective);
19943
19967
  Vue.prototype.$auth = auth;
19944
19968
  Vue.prototype.$isInDepartment = isInDepartment;
19945
19969
  };
19946
19970
  return {
19947
- state: state,
19948
19971
  AdminContainer: Container,
19949
19972
  auth: auth,
19950
19973
  isInDepartment: isInDepartment