Can someone help me with using itemList
in a template? The itemlist
is a static list, but I am unsure of where to declare it and how to export it to the template.
<template>
<table class="table table is-striped is-narrow is-fullwidth">
<thead>
<tr>
<th>category</th>
<th>value</th>
</tr>
</thead>
<tbody>
<tr v-for="item in itemList" :key="item.key">
<td>{{ item.label }}</td>
<td>{{ currentBanner[item.key] }}</td>
</tr>
</tbody>
</table>
</template>
<script lang="ts">
@Component({
name: 'GroupingBannerModal',
})
export default class GroupingBannerModal extends Vue {
itemList = [
{ key: 'id', label: 'ID' },
{ key: 'source', label: 'ソース' },
{ key: 'agency', label: '代理店' },
{ key: 'media', label: '媒体' },
]
@Prop({ type: Array })
private lstBannerGrouped!: Banner[]
private currentBanner: Banner | null = null
}
</script>