import { ComputedRef } from 'vue'; import { useState } from './useState'; export function useRole() { function hasAny(roles: string[]): boolean { const { getRoles } = useState(); const roleStore: ComputedRef = getRoles(); for (const role of roles) { if (roleStore.value.indexOf(role) !== -1) return true; } return false; } return { hasAny, }; }