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

feat(App): add scroll-view

上级 372e8a91
<template>
<view>
<view class="banner">
<image class="banner-img" :src="cover"></image>
<text class="banner-title">{{title}}</text>
<!-- #ifdef APP -->
<scroll-view style="flex: 1">
<!-- #endif -->
<view>
<view class="banner">
<image class="banner-img" :src="cover"></image>
<text class="banner-title">{{title}}</text>
</view>
<view class="article-content">
<text>{{htmlNodes}}</text>
</view>
</view>
<view class="article-content">
<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;
......@@ -104,4 +109,4 @@
font-size: 30rpx;
margin-bottom: 30rpx;
}
</style>
</style>
\ No newline at end of file
<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 {
......@@ -27,4 +32,4 @@
font-size: 30rpx;
margin-bottom: 30rpx;
}
</style>
</style>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册