提交 58152aa3 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

feat(App): add scroll-view

上级 372e8a91
<template>
<!-- #ifdef APP -->
<scroll-view style="flex: 1">
<!-- #endif -->
<view>
<view class="banner">
<image class="banner-img" :src="cover"></image>
......@@ -8,18 +11,20 @@
<text>{{htmlNodes}}</text>
</view>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script>
export default {
data() {
return {
htmlNodes: "",
pageVisible: false,
title: '',
cover : "",
post_id : "",
cover: "",
post_id: "",
}
},
onLoad(event) {
......@@ -37,7 +42,7 @@
uni.request({
url: 'https://unidemo.dcloud.net.cn/api/news/36kr/' + this.post_id,
success: (data) => {
if(this.pageVisible){
if (this.pageVisible) {
if (data.statusCode == 200) {
const result = data.data as UTSJSONObject
this.htmlNodes = result["content"] as string;
......
<template>
<!-- #ifdef APP -->
<scroll-view style="flex: 1">
<!-- #endif -->
<view class="article-content">
<text>{{content}}</text>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script>
export default {
data() {
return {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册