UNPKG

baked-recipe-admin

Version:

Baked is an opinionated framework for .NET in backend and Nuxt in frontend. This is a recipe package that brings together all the components one needs for an Admin UI.

16 lines (12 loc) 332 B
export default function() { function find(conditional, data) { const conditions = conditional.conditions.filter(component => data[component.prop] === component.value); if(conditions.length > 0) { return conditions[0].component; } return conditional.fallback; } return { find }; }