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