text: /*
   * @Author: your name
   * @Date: 2020-07-06 15:11:36
   * @LastEditTime: 2020-07-15 09:44:19
   * @LastEditors: Please set LastEditors
   * @Description: In User Settings Edit
   * @FilePath: /elementui/Users/admin/vuestudy/vue-admin-template-waterstation/src/permission.js
   */
  
  // import store from '@/store'
  
  // /**
  //  * @param {Array} value
  //  * @returns {Boolean}
  //  * @example see @/views/permission/directive.vue
  //  */
  // export default function checkPermission(value) {
  //   if (value && value instanceof Array && value.length > 0) {
  //     const role = store.getters['user/currentUserRole']();
  //     const permissionRoles = value
  
  //     const hasPermission = roles.some(role => {
  //       return permissionRoles.includes(role)
  //     })
  
      
  //     if (!hasPermission) {
  //       return false
  //     }
  //     return true
  //   } else {
  //     console.error(`need roles! Like v-permission="['admin','editor']"`)
  //     return false
  //   }
  // }
  
  // export default {
  //   inserted(el, binding) {
  //     checkPermission(el, binding)
  //   },
  //   update(el, binding) {
  //     checkPermission(el, binding)
  //   }
  // }
  