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

feat(App): add scroll-view

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