<route lang="json">
{
  "style": {
    "navigationBarTitleText": "详情",
    "navigationBarBackgroundColor": "#fff"
  }
}
</route>
<script setup lang="ts">
import { logo } from '../../../core/libs/svgs'
import { getContent } from '../../../core/libs/requests'
import Article from '../components/article.vue'

const id = ref()
const { data, run } = useRequest(() => getContent({ id: id.value }))
onLoad(async (query: { id: string }) => {
  id.value = query.id
  await run()
})
</script>
<template>
  <div class="flex-grow bg-white">
    <Article
      :title="data?.title"
      :author="{ name: '筑巢荟' }"
      :content="data?.contentDetail"
      :createAt="data?.createTime"
      :viewNum="data?.viewsCount"
    >
      <template #avatar><wd-img width="28" height="28" :src="logo"></wd-img></template>
    </Article>
  </div>
</template>
