<template>
    <app-view class="new-details">
        <template #header>
            <app-navbar title="资讯详情" />
        </template>
        <section class="new-details__container" v-if="details">
            <h1>{{ details.title }}</h1>
            <h4>
                <span>{{ details.author }}</span>
                <span>{{ details.creaedate }}</span>
            </h4>
            <p v-html="formatHtmlString(details.context)"></p>
        </section>
    </app-view>
</template>

<script lang="ts" setup>

import { shallowRef } from 'vue'
import { useNavigation } from '@/hooks/navigation'
import { formatHtmlString } from '@/filters'

const { route } = useNavigation()
const params = route.params.details
const details = shallowRef<Model.SiteColumnDetailRsp>()

if (params) {
    details.value = JSON.parse(params.toString())
}

</script>

<style lang="less">
@import './index.less';
</style>