pages.js代码
{
"pages" : [
//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path" : "pages/start/start",
"style" : {
"navigationBarTitleText" : "详情",
"app-plus" : {
"titleNView" : false
}
}
},
{
"path" : "pages/index/index",
"style" : {
"navigationBarTitleText" : "uni-app",
"app-plus" : {
"titleNView" : false ,//禁用原生导航栏
"bounce" : "none",
"scrollIndicator" : "none"
}
}
},
{
"path" : "pages/renmai/renmai",
"style" : {
"navigationBarTitleText" : "uni-app",
"app-plus" : {
"titleNView" : false //禁用原生导航栏
}
}
},
{
"path" : "pages/event/event",
"style" : {
"navigationBarTitleText" : "uni-app",
"app-plus" : {
"titleNView" : {
"splitLine":{"color":"#d8d8d8"}
}
}
}
},
{
"path" : "pages/user/user",
"style" : {
"navigationBarTitleText" : "uni-app",
"app-plus" : {
"titleNView" : false //禁用原生导航栏
}
}
},
{
"path" : "pages/news/news",
"style" : {}
},
{
"path" : "pages/main/main",
"style" : {}
}
],
"globalStyle" : {
"navigationBarTextStyle" : "black",
"navigationBarTitleText" : "uni-app",
"navigationBarBackgroundColor" : "#ffffff",
"backgroundColor" : "#F8F8F8"
},
"tabBar" : {
"color" : "#7A7E83",
"selectedColor" : "#007AFF",
"borderStyle" : "#dddddd",
"backgroundColor" : "#ffffff",
"list" : [
{
"pagePath" : "pages/index/index",
"iconPath" : "static/component.png",
"selectedIconPath" : "static/componentHL.png",
"text" : "组件"
},
{
"pagePath" : "pages/renmai/renmai",
"iconPath" : "static/api.png",
"selectedIconPath" : "static/apiHL.png",
"text" : "接口"
},
{
"pagePath" : "pages/user/user",
"iconPath" : "static/template.png",
"selectedIconPath" : "static/templateHL.png",
"text" : "模板"
}
]
}
}
start.vue页代码
<template>
<view>
<view class="content">
<text class="title">{{title}}</text>
<text class="title">sfdafsdasfd</text>
</view>
</view>
</template>
<script>
export default {
data: {
title:'开屏页',
},
onShow() {
uni.switchTab({
url: '../index/index'
});
}
}
</script>
跳转报错
OnWebviewEvent: __DOMReady, WebviewId: 1 not found
这报错信息是什么意思啊?是我配置的不对吗?
3 个回复
独孤雄鹰 (作者)
加上setTimeout就不报错了,是不是因为跳转的快,index页面还没有渲染完成的原因啊?
4***@qq.com - xiaobai
加了延时器的话还会在原来的页面停留而且跳转动画太难看。。。。
小菜啊 - 业精于勤荒于嬉
把../index/index改成/pages/index/index就好了