export default { setup() { const { ref, computed } = Vue; const recipes = ref(null); fetch("https://hub.xpub.nl/soupboat/cookbook/get") .then((res) => res.json()) .then((data) => (recipes.value = data)); const style = function (index) { return { transform: `translate(${index * 10}px, ${index * 10}px)`, }; }; const browse = function () { let recipe = recipes.value.pop(); recipes.value.unshift(recipe); }; return { recipes, style, browse }; }, template: `
{{recipe.description}}
{{recipe.who}}