onLoad() {  
        uni.showLoading({  
            title: '加载中...',  
        })  
    },  
    onReady() {  
        setTimeout(() => {  
            uni.hideLoading()  
        }, 2000)  
    },                                    - 发布:2024-05-29 14:59
 - 更新:2024-05-30 09:50
 - 阅读:979
 
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win11
HBuilderX类型: Alpha
HBuilderX版本号: 4.17
手机系统: Android
手机系统版本号: Android 14
手机厂商: 小米
手机机型: 14
页面类型: vue
vue版本: vue3
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
                                    
                                    
                                         
                                
                                                                                                操作步骤:
                                    
                                        onLoad() {  
        uni.showLoading({  
            title: '加载中...',  
        })  
    },  
    onReady() {  
        setTimeout(() => {  
            uni.hideLoading()  
        }, 2000)  
    },
                                     
                                
                                                                                                onLoad() {  
        uni.showLoading({  
            title: '加载中...',  
        })  
    },  
    onReady() {  
        setTimeout(() => {  
            uni.hideLoading()  
        }, 2000)  
    },                                    预期结果:
                                    
                                    
                                        onLoad() {  
        uni.showLoading({  
            title: '加载中...',  
        })  
    },  
    onReady() {  
        setTimeout(() => {  
            uni.hideLoading() //关闭loading  
        }, 2000)  
    },
                                     
                                
                                                                                                onLoad() {  
        uni.showLoading({  
            title: '加载中...',  
        })  
    },  
    onReady() {  
        setTimeout(() => {  
            uni.hideLoading() //关闭loading  
        }, 2000)  
    },                                    实际结果:
                                    
                                    
                                        onLoad() {  
        uni.showLoading({  
            title: '加载中...',  
        })  
    },  
    onReady() {  
        setTimeout(() => {  
            uni.hideLoading() // 无法关闭  
        }, 2000)  
    },
                                     
                                
                                                            onLoad() {  
        uni.showLoading({  
            title: '加载中...',  
        })  
    },  
    onReady() {  
        setTimeout(() => {  
            uni.hideLoading() // 无法关闭  
        }, 2000)  
    },                                    bug描述:
详见下面 视频演示
                                                                                                                                                                                                                                                            
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
                                    
                                    
                                    
                                                                                                        套马杆的套子 - 没有解决不了的问题,只有解决不完的问题
刚测试了下,android 14没问题
<template>  
    <view>  
        test  
    </view>  
</template>  
<script>  
    export default {  
        data() {  
            return {  
            }  
        },  
        onLoad() {  
            console.log('11111111111111');  
            uni.showLoading({  
                title: '加载中...',  
            })  
            // setTimeout(() => {  
            //  uni.hideLoading() // 无法关闭    
            // }, 2000)  
        },  
        onReady() {  
            console.log('222222222222222');  
            setTimeout(() => {  
                uni.hideLoading() // 无法关闭    
            }, 2000)  
        },  
        methods: {  
        }  
    }  
</script>  
<style>  
</style>                                        
            
            
            
                                    
                                    
                                                                    