<template>
<JobTemplate :job="job" />
</template>
<script>
import JobTemplate from "~/components/Templates/Pages/JobTemplate.vue"
import api from "~/database/api.js"
export default {
props: {
jobID: String
},
computed: { // computed не работает, так как нельзя async
job: async () => {
const res = await api.getJobByID(jobID)
return res.data
}
},
components: {
JobTemplate
}
}
</script>
<IterableTableTemplate :items="_jobs" :fields="fields"></IterableTableTemplate>
<tr v-for="item in items" :key="item._id" :class="[...item.class]">
<td v-for="(field, keyField) in fields" :key="keyField">
<component v-if="field.feather" :is="feather" :icon="item[keyField]"></component>
<template v-else>{{ item[keyField] }}</template>
</td>
</tr>