旺仔牛奶
旺仔牛奶
  • 发布:2020-12-16 17:22
  • 更新:2020-12-16 17:22
  • 阅读:1407

置顶弹窗 subVue 的实现

分类:uni-app
// home.vue  调用弹窗  
const noticePopup = uni.getSubNVueById('notice'); //获取  
noticePopup.show("fade-in", 300) // 显示   

// notice.nvue  弹窗页面  
uni.getCurrentSubNVue().hide('fade-out')//隐藏  

相关文档:https://uniapp.dcloud.io/api/window/subNVues?id=app-getsubnvuebyid  

// pages.json 配置subVue页面  

        {  
            "path": "pages/home/home",  
            "style": {  
                "navigationBarTitleText": "首页",  
                "enablePullDownRefresh": true,  
                "onReachBottomDistance": 50,  
                "titleNView": false,  
                "app-plus": {  
                    "bounce": "none",  
                    "subNVues": [{  
                            "id": "popup",  
                            "path": "paltform/app-plus/subNVue/popup/popup",  
                            "type": "popup",  
                            "style": {  
                                "position": "absolute",  
                                "top": "0",  
                                "left": "0",  
                                "width": "100%",  
                                "height": "100%",  
                                "background": "transparent"  
                            }  
                        },  
                        {  
                            "id": "notice",  
                            "path": "paltform/app-plus/subNVue/popup/notice",  
                            "type": "popup",  
                            "style": {  
                                "position": "absolute",  
                                "top": "0",  
                                "left": "0",  
                                "width": "100%",  
                                "height": "100%",  
                                "background": "transparent"  
                            }  
                        }  
                    ]  
                }  
            }  
        },  

subVue配置:https://uniapp.dcloud.io/collocation/pages?id=app-subnvues  
0 关注 分享

要回复文章请先登录注册