Absorbed66c
Absorbed66c
  • 发布:2020-06-24 18:02
  • 更新:2020-06-26 03:28
  • 阅读:601

NVUE动态设置是否开启下拉刷新 图标消失

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: Window7

HBuilderX类型: 正式

HBuilderX版本号: 2.7.14

手机系统: Android

手机系统版本号: Android 10

手机厂商: 华为

手机机型: P30Pro

页面类型: nvue

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:

反复开关几次下拉刷新后 下拉刷新功能正常但是下拉刷新的小图标不见了

预期结果:

不管反复开关多少次下拉刷新,图标都得有

实际结果:

图标不见了

bug描述:

function getCurrentWebView(){  
  let pages = getCurrentPages()  
  let page =pages[pages.length - 1]  
  // #ifdef APP-PLUS  
    const currentWebview = page.$getAppWebview();//页面栈最顶层就是当前webview  
    return currentWebview  
  // #endif  
 }  
switchPullRefresh(isSupport) {  
                // #ifdef APP-PLUS  
                const currentWebview = getCurrentWebView()  
                currentWebview.setStyle({  
                    pullToRefresh: {  
                        support: isSupport  
                    }  
                });  
            // #endif  
            }  
2020-06-24 18:02 负责人:无 分享
已邀请:
Absorbed66c

Absorbed66c (作者) - 码农一枚

<template>  
    <div class="red" @tap="clickdiv">  
        点我切换  
    </div>  
</template>  

<script>  
    import Test from "./components/test.vue"  
    export default{  
        components:{  
            Test  
        },  
        data(){  
            return  {  
                flag:true  
            }  
        },  
        onPullDownRefresh() {  
            setTimeout(()=>{  
                uni.stopPullDownRefresh();  
            },2000);  
        },  
        methods:{  
            clickdiv(){  
                this.flag =!this.flag  
                console.log(this.flag)  
                uni.showToast({  
                        icon:'none',  
                    title: this.flag ?'开启下拉刷新':'禁用下拉刷新',  
                    duration: 1000  
                });  
                this.switchPullRefresh(this.flag)  
            },  
            switchPullRefresh(isSupport) {    
                let pages = getCurrentPages()  
                let page =pages[pages.length - 1]    
                const currentWebview = page.$getAppWebview();//页面栈最顶层就是当前webview    
                currentWebview.setStyle({    
                        pullToRefresh: {    
                                support: isSupport    
                        }    
                });    
            }    
        }  
    }  
</script>  

<style lang="scss" scoped>  
 .red{  
     background-color: red;  
 }  
</style>
Absorbed66c

Absorbed66c (作者) - 码农一枚

页面是nvue的 之前没用nvue是没问题的

该问题目前已经被锁定, 无法添加新回复