<script setup lang="ts">
import { ref } from 'vue';

const plans = ref([])

fetch('/api/plans', {
  method: 'GET',
  headers: {
    'Authorization': 'Basic Zm9yY2VuOg=='
  }
}).then(x => x.json())
  .then(x => plans.value = x)
</script>

<template>
  <div class="w-full">
    Lista de planes
    <div v-for="plan in plans">
      Plan numero {{ plan.id }} {{ plan.name }}
      <router-link :to="'/plan/' + plan.id">ir</router-link>
    </div>
  </div>
</template>
