This commit is contained in:
username 2024-05-27 21:55:46 +08:00
parent a291cddecd
commit 07da039a3a
2 changed files with 8 additions and 5 deletions

View File

@ -1,5 +1,4 @@
<template> <template>
<!-- 标签 -->
<div> <div>
<header> <header>
<navigationBar /> <navigationBar />

View File

@ -1,8 +1,11 @@
<template> <template>
<div> <div>
<main class="main-content"> <main class="main-content">
<div v-if="!detailContent">暂时没有内容</div>
<!-- 显示详情内容 --> <!-- 显示详情内容 -->
<div v-html="detailContent"></div> <div v-for="(item, index) in detailContent" :key="index">
<p v-html="item.content"></p>
</div>
</main> </main>
</div> </div>
</template> </template>
@ -22,11 +25,12 @@ export default {
}, },
methods: { methods: {
fetchContent () { fetchContent () {
const id = this.$route.params.id // ID const id = this.$route.params.id //
// ID //
getlist(id).then(response => { getlist(id).then(response => {
// //
this.detailContent = response.data[0].content // this.detailContent = response.data
console.log(response)
}).catch(error => { }).catch(error => {
console.error('Error fetching content:', error) console.error('Error fetching content:', error)
}) })