export default {
  methods: {
    checkPrivilege(type, field, routeName = null) {
      const key = `${type}_${field}`.toLowerCase();
      let routerName = routeName || this.$route.name;
      const routerPrivileges =
        this.$store.state.app.privilegeMap[routerName] || [];
      return routerPrivileges.includes(key);
    },
  },
};
