to_inventory/front/pages/tmc/index.vue

22 lines
559 B
Vue

<script setup lang="ts">
import { apiBase } from '~/helpers';
const headers = new Headers();
headers.append("Content-Type", "application/json");
const items = ref()
onMounted(async () => {
const items_data = await $fetch<ApiTypeTmc>(`${apiBase}/tmc/items/`, { headers })
items.value = items_data.results
})
</script>
<template>
<template v-for="item in items">
<h2>{{ item.name }}</h2>
<ul>
<li v-for="child in item.fields">
{{ child.name }}
</li>
</ul>
</template>
</template>