- 发布:2022-01-16 11:56
- 更新:2023-09-21 15:31
- 阅读:841
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10 20H2
HBuilderX类型: 正式
HBuilderX版本号: 3.3.8
手机系统: 全部
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
测试过的手机:
示例代码:
"app-plus": {
"subNVues": [
{
"id": "iliveBox_index",
"path": "pages/subVue/play",
"type":"popup",
"style": {
"background": "transparent",
"mask": "transparent",
"position": "absolute",
"right": "10px",
"bottom": "200px",
"width": "180rpx",
"height": "260rpx"
}
}
]
}
const subNVue = uni.getSubNVueById("iliveBox_index");
subNVue.show('',300)
subNVue.close();
subNVue.show('',300);//再次show就会报错无法运行
"app-plus": {
"subNVues": [
{
"id": "iliveBox_index",
"path": "pages/subVue/play",
"type":"popup",
"style": {
"background": "transparent",
"mask": "transparent",
"position": "absolute",
"right": "10px",
"bottom": "200px",
"width": "180rpx",
"height": "260rpx"
}
}
]
}
const subNVue = uni.getSubNVueById("iliveBox_index");
subNVue.show('',300)
subNVue.close();
subNVue.show('',300);//再次show就会报错无法运行
操作步骤:
"app-plus": {
"subNVues": [
{
"id": "iliveBox_index",
"path": "pages/subVue/play",
"type":"popup",
"style": {
"background": "transparent",
"mask": "transparent",
"position": "absolute",
"right": "10px",
"bottom": "200px",
"width": "180rpx",
"height": "260rpx"
}
}
]
}
const subNVue = uni.getSubNVueById("iliveBox_index");
subNVue.show('',300);
subNVue.close();
subNVue.show('',300);//再次show就会报错无法运行
"app-plus": {
"subNVues": [
{
"id": "iliveBox_index",
"path": "pages/subVue/play",
"type":"popup",
"style": {
"background": "transparent",
"mask": "transparent",
"position": "absolute",
"right": "10px",
"bottom": "200px",
"width": "180rpx",
"height": "260rpx"
}
}
]
}
const subNVue = uni.getSubNVueById("iliveBox_index");
subNVue.show('',300);
subNVue.close();
subNVue.show('',300);//再次show就会报错无法运行
预期结果:
可以正常show显示子窗体
可以正常show显示子窗体
实际结果:
控制台报错,无法show显示子窗体
[Vue warn]: Error in nextTick: "Error: Unable to find SubNVue, id=iliveBox_index"
控制台报错,无法show显示子窗体
[Vue warn]: Error in nextTick: "Error: Unable to find SubNVue, id=iliveBox_index"
bug描述:
subNvue使用close方法关闭后就不能再show显示了!
控制台会提示错误[Vue warn]: Error in nextTick: "Error: Unable to find SubNVue, id=iliveBox_index" (iliveBox_index为我的subNvue页面ID )