50 lines
1.1 KiB
Vue
50 lines
1.1 KiB
Vue
|
<!-- 文章展示 -->
|
||
|
<template>
|
||
|
<pb-layout class="set-wrap" :title="state.title" :bgStyle="{ color: '#FFF' }">
|
||
|
<view class="ss-p-30">
|
||
|
<mp-html class="richtext" :content="state.content" />
|
||
|
</view>
|
||
|
</pb-layout>
|
||
|
</template>
|
||
|
|
||
|
<script setup>
|
||
|
import { onLoad } from '@dcloudio/uni-app'
|
||
|
import { reactive } from 'vue'
|
||
|
|
||
|
const state = reactive({
|
||
|
title: '',
|
||
|
content: '',
|
||
|
})
|
||
|
|
||
|
async function getRichTextContent(id, title) {
|
||
|
// 获取文章配置
|
||
|
// state.content = data.content;
|
||
|
// 标题不一致时,修改标题
|
||
|
// if (state.title !== data.title) {
|
||
|
// state.title = data.title;
|
||
|
// uni.setNavigationBarTitle({
|
||
|
// title: state.title,
|
||
|
// });
|
||
|
// }
|
||
|
}
|
||
|
|
||
|
onLoad((options) => {
|
||
|
if (options.title) {
|
||
|
state.title = options.title
|
||
|
uni.setNavigationBarTitle({
|
||
|
title: state.title,
|
||
|
})
|
||
|
}
|
||
|
// getRichTextContent(options.id, options.title);
|
||
|
})
|
||
|
</script>
|
||
|
|
||
|
<style lang="scss" scoped>
|
||
|
.set-title {
|
||
|
margin: 0 30rpx;
|
||
|
}
|
||
|
|
||
|
.richtext {
|
||
|
}
|
||
|
</style>
|