Skip to content
Snippets Groups Projects
Commit 36019a00 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

WIP: compute headers

parent 50e334e8
No related branches found
No related tags found
2 merge requests!6Automatic systems list,!5Optional title abstract
Pipeline #111308 failed with stage
in 2 minutes and 48 seconds
---
title: AbiE
tableDescription:
doi: 10.1093/nar/gkt1419
other: blabla
---
AbiE is a family of an anti-phage defense systems. They act through a Toxin-Antitoxin mechanism, and are comprised of a pair of genes, with one gene being toxic while the other confers immunity to this toxicity.
......
<script setup lang="ts">
const { data, error, pending } = await useAsyncData('list-defense-systems', () => queryContent('/defense-systems').find())
const defaultHeaders = ref([{ title: 'System', key: "title" }])
console.log(data.value)
const tableDescriptionKey = ref("tableDescription")
const headers = data.value ? ref(Array.from(data.value.reduce((headerSet, df) => {
if (df?.[tableDescriptionKey.value]) {
return new Set([...headerSet, ...Object.keys(df[tableDescriptionKey.value])])
}
else { return headerSet }
}, new Set())).map(value => { return { title: value, key: value } })
) : defaultHeaders
console.log(headers.value)
</script>
<template>
<v-card :loading="pending"></v-card>
</template>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment