定义checkPermission方法,

// 引用mapGetters 
import { mapGetters } from 'vuex'


computed: {
  ...mapGetters(['roles'])
},

// 定义验证角色权限方法 methods
    checkPermission(value) {
      if (value && value instanceof Array && value.length > 0) {
        const roles = this.roles

        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
      }
    }

替换 原来的v-permission="[]" 为 v-if="checkPermission([])"