50 lines
1.2 KiB
Vue
50 lines
1.2 KiB
Vue
<template>
|
|
<view>
|
|
<u-sticky offset-top="0" customNavHeight="0">
|
|
<!-- 顶部 -->
|
|
<uititle title="文章详情"></uititle>
|
|
</u-sticky>
|
|
<view class="m-a bg-white p-30">
|
|
<view class="text-50 font-bold">{{ info.name }}</view>
|
|
<view class="mt-20 text-gray text-28 pb-20 border-bottom">{{ info._add_time_str }}</view>
|
|
<view v-html="info.content" class="mt-20"></view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import uititle from "@/components/common/title.vue";
|
|
|
|
export default {
|
|
name: "detail",
|
|
components: {uititle},
|
|
data() {
|
|
return {
|
|
info: {
|
|
name: '',
|
|
content: ''
|
|
}
|
|
}
|
|
},
|
|
onLoad(option) {
|
|
if (option.id) this.getInfo(option.id);
|
|
},
|
|
methods: {
|
|
async getInfo(id) {
|
|
const res = await vk.callFunction({
|
|
url: `client/otherArticle/list/pub/getDetail`,
|
|
data: {id}
|
|
});
|
|
this.info = res
|
|
const regex = new RegExp('img','gi')
|
|
this.info.content = this.info.content.replace(regex,`img style="max-width:100%;"`)
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
img {
|
|
width: 100% !important;
|
|
}
|
|
</style> |