You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.6 KiB
58 lines
1.6 KiB
<template>
|
|
<!-- Banner -->
|
|
<Banner :data="form" />
|
|
|
|
<div v-if="form" class="flex flex-col w-full md:w-3/4 m-auto my-3">
|
|
|
|
<Breadcrumb :data="form" />
|
|
|
|
<div class="p-4 mt-4 flex flex-col gap-xl">
|
|
<div class="article-title-box p-4">
|
|
<div class="text-3xl">{{ form.title }}</div>
|
|
<div class="text-sm pt-3 text-gray-4 flex gap-xl">
|
|
<span>{{ form.createTime }}</span>
|
|
<span>浏览:{{ form.actualViews }}</span>
|
|
</div>
|
|
<el-divider style="height: 1px " />
|
|
</div>
|
|
<div class="content leading-8 text-xl p-3 text-gray-8" v-html="form.content"></div>
|
|
</div>
|
|
</div>
|
|
<div v-if="!form">
|
|
<el-empty description="404 页面不存在"></el-empty>
|
|
</div>
|
|
</template>
|
|
<script setup lang="ts">
|
|
import type {ApiResult} from "~/api";
|
|
import {useServerRequest} from "~/composables/useServerRequest";
|
|
import type {Goods} from "~/api/shop/goods/model";
|
|
import type {Article} from "~/api/cms/article/model";
|
|
import Breadcrumb from "~/components/Breadcrumb.vue";
|
|
|
|
const route = useRoute();
|
|
const { query, params } = route;
|
|
const { id } = params;
|
|
const activeName = ref('parameter');
|
|
const rate = ref(4);
|
|
|
|
|
|
// 页面信息
|
|
const form = ref<Article | any>();
|
|
|
|
// 请求数据
|
|
const { data: info } = await useServerRequest<ApiResult<Article>>('/cms/article/' + id)
|
|
form.value = info.value?.data;
|
|
// form.value.files = JSON.parse(form.value.files);
|
|
form.value.num = 1;
|
|
form.value.radio = '0'
|
|
|
|
const handleClick = (tab, event) => {
|
|
console.log(tab, event);
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.content *{
|
|
max-width: 100%;
|
|
}
|
|
</style>
|