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>
<!-- 标签 -->
<div>
<header>
<navigationBar />

View File

@ -1,8 +1,11 @@
<template>
<div>
<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>
</div>
</template>
@ -22,11 +25,12 @@ export default {
},
methods: {
fetchContent () {
const id = this.$route.params.id // ID
// ID
const id = this.$route.params.id //
//
getlist(id).then(response => {
//
this.detailContent = response.data[0].content //
this.detailContent = response.data
console.log(response)
}).catch(error => {
console.error('Error fetching content:', error)
})