|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="main">
|
|
<div class="main">
|
|
|
- <van-nav-bar title="资讯详情" @click-left="$router.back()" left-arrow fixed placeholder safe-area-inset-top />
|
|
|
|
|
- <div class="contentHtml" v-html="content"></div>
|
|
|
|
|
|
|
+ <van-nav-bar ref="navbar" title="资讯详情" @click-left="$router.back()" left-arrow fixed placeholder safe-area-inset-top />
|
|
|
|
|
+ <div class="contentHtml" :style="{height:height+'px'}" v-html="content"></div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
@@ -11,15 +11,22 @@ export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
content: '',
|
|
content: '',
|
|
|
|
|
+ height: '100%',
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ mounted() {
|
|
|
|
|
+ window.scrollTo(0, 0)
|
|
|
|
|
+ var navbarheight = this.$refs.navbar.height
|
|
|
|
|
+ this.height = document.documentElement.clientHeight - navbarheight - 10
|
|
|
|
|
+ console.log(navbarheight)
|
|
|
|
|
+ },
|
|
|
created() {
|
|
created() {
|
|
|
this.id = this.$route.query.id
|
|
this.id = this.$route.query.id
|
|
|
this.getArticleMessage()
|
|
this.getArticleMessage()
|
|
|
},
|
|
},
|
|
|
- methods: {
|
|
|
|
|
|
|
+ methods: {
|
|
|
async getArticleMessage() {
|
|
async getArticleMessage() {
|
|
|
- const res = await serverAPI('zpsmzxxqjk',{ id: this.id })
|
|
|
|
|
|
|
+ const res = await serverAPI('zpsmzxxqjk', { id: this.id })
|
|
|
this.content = res.data.content
|
|
this.content = res.data.content
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
@@ -27,9 +34,10 @@ export default {
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.main {
|
|
.main {
|
|
|
|
|
+ height: 100%;
|
|
|
padding: 0 30px;
|
|
padding: 0 30px;
|
|
|
font-size: 24px;
|
|
font-size: 24px;
|
|
|
- padding-bottom: 30px;
|
|
|
|
|
|
|
+ // padding-bottom: 30px;
|
|
|
::v-deep p {
|
|
::v-deep p {
|
|
|
margin: 0 !important;
|
|
margin: 0 !important;
|
|
|
padding: 0 !important;
|
|
padding: 0 !important;
|
|
@@ -38,7 +46,8 @@ export default {
|
|
|
</style>
|
|
</style>
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
|
.contentHtml {
|
|
.contentHtml {
|
|
|
- overflow: hidden;
|
|
|
|
|
|
|
+ overflow-x: hidden;
|
|
|
|
|
+ overflow-y: auto;
|
|
|
img {
|
|
img {
|
|
|
max-width: calc(100% - 60px);
|
|
max-width: calc(100% - 60px);
|
|
|
height: auto;
|
|
height: auto;
|