index.vue代码:
<template>
<view>
<view>
<button @tap="test">test</button>
<navigator url="condition?id=navigate" hover-class="navigator-hover">
<button type="default">跳转到新页面</button>
</navigator>
</view>
</view>
</template>
<script>
export default {
methods: {
test: function (e) {
console.log("aaaaaaa");
uni.navigateTo({
url:'condition?id=1&name=2'
})
}
}
}
</script>
被跳转页condition.vue代码
<script>
export default {
data:{},
onLoad: function (option) {
console.log(option.id);
}
}
</script>
控制台打印结果
14:20:58.533 undefined at pages/index/condition.vue:5
参考文档
http://uniapp.dcloud.io/api/ui/navigate?id=redirectto
附言
如果把 navigateTo 换成 redirectTo 传参就可以成功了
lyg (作者)
也就是说,如果不把页面配置到tabBar里面,navigateTo传参就没问题了吧
2018-09-06 15:52
Neil_HL
回复 lyg:是的
2018-09-06 15:55