forked from zhurui/management
1 line
3.8 KiB
JSON
1 line
3.8 KiB
JSON
|
{"remainingRequest":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\directive\\permission.js","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\directive\\permission.js","mtime":1614735254000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.array.includes\";\nimport \"core-js/modules/es6.string.includes\";\nimport store from '@/store';\nimport Vue from 'vue';\n\nfunction checkPermission(el, binding) {\n var value = binding.value;\n var roles = store.getters && store.getters.roles;\n\n if (value && value instanceof Array) {\n if (value.length > 0) {\n var permissionRoles = value;\n var hasPermission = roles.some(function (role) {\n return permissionRoles.includes(role);\n });\n\n if (!hasPermission) {\n el.parentNode && el.parentNode.removeChild(el);\n }\n }\n } else {\n throw new Error(\"need roles! Like v-permission=\\\"['admin','editor']\\\"\");\n }\n}\n/* \n @title 全局 双击 复制\n @des 使用 v-copy 绑定元素 双击元素 复制元素文本内容\n*/\n\n\nVue.directive('permission', {\n inserted: function inserted(el, binding) {\n checkPermission(el, binding);\n },\n update: function update(el, binding) {\n checkPermission(el, binding);\n }\n});",{"version":3,"sources":["C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\directive\\permission.js"],"names":["store","Vue","checkPermission","el","binding","value","roles","getters","Array","length","permissionRoles","hasPermission","some","role","includes","parentNode","removeChild","Error","directive","inserted","update"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,SAAlB;AACA,OAAOC,GAAP,MAAgB,KAAhB;;AAEA,SAASC,eAAT,CAAyBC,EAAzB,EAA6BC,OAA7B,EAAsC;AAAA,MAC1BC,KAD0B,GAChBD,OADgB,CAC1BC,KAD0B;AAElC,MAAMC,KAAK,GAAGN,KAAK,CAACO,OAAN,IAAiBP,KAAK,CAACO,OAAN,CAAcD,KAA7C;;AAEA,MAAID,KAAK,IAAIA,KAAK,YAAYG,KAA9B,EAAqC;AACjC,QAAIH,KAAK,CAACI,MAAN,GAAe,CAAnB,EAAsB;AAClB,UAAMC,eAAe,GAAGL,KAAxB;AAEA,UAAMM,aAAa,GAAGL,KAAK,CAACM,IAAN,CAAW,UAAAC,IAAI,EAAI;AACrC,eAAOH,eAAe,CAACI,QAAhB,CAAyBD,IAAzB,CAAP;AACH,OAFqB,CAAtB;;AAIA,UAAI,CAACF,aAAL,EAAoB;AAChBR,QAAAA,EAAE,CAACY,UAAH,IAAiBZ,EAAE,CAACY,UAAH,CAAcC,WAAd,CAA0Bb,EAA1B,CAAjB;AACH;AACJ;AACJ,GAZD,MAYO;AACH,UAAM,IAAIc,KAAJ,wDAAN;AACH;AACJ;AAED;;;;;;AAKAhB,GAAG,CAACiB,SAAJ,CAAc,YAAd,EAA4B;AACxBC,EAAAA,QADwB,oBACfhB,EADe,EACXC,OADW,EACF;AAClBF,IAAAA,eAAe,CAACC,EAAD,EAAKC,OAAL,CAAf;AACH,GAHuB;AAIxBgB,EAAAA,MAJwB,kBAIjBjB,EAJiB,EAIbC,OAJa,EAIJ;AAChBF,IAAAA,eAAe,CAACC,EAAD,EAAKC,OAAL,CAAf;AACH;AANuB,CAA5B","sourcesContent":["import store from '@/store'\nimport Vue from 'vue'\n\nfunction checkPermission(el, binding) {\n const { value } = binding\n const roles = store.getters && store.getters.roles\n\n if (value && value instanceof Array) {\n if (value.length > 0) {\n const permissionRoles = value\n\n const hasPermission = roles.some(role => {\n return permissionRoles.includes(role)\n })\n\n if (!hasPermission) {\n el.parentNode && el.parentNode.removeChild(el)\n }\n }\n } else {\n throw new Error(`need roles! Like v-permission=\"['admin','editor']\"`)\n }\n}\n\n/* \n @title 全局 双击 复制\n @des 使用 v-copy 绑定元素 双击元素 复制元素文本内容\n*/\n\nVue.directive('permission', {\n inserted(el, binding) {\n checkPermission(el, binding)\n },\n update(el, binding) {\n checkPermission(el, binding)\n }\n})"]}]}
|