13
This commit is contained in:
parent
a291cddecd
commit
07da039a3a
@ -1,5 +1,4 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 标签 -->
|
|
||||||
<div>
|
<div>
|
||||||
<header>
|
<header>
|
||||||
<navigationBar />
|
<navigationBar />
|
||||||
|
@ -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)
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user