页面的onLoad
- 页面跳转的时候可以传参,页面接受参数,就是在onLoad里面接受的
例如:
methods: {open() {uni.navigateTo({url: "../test-page/test-page?id=uni"})}}
另外一个页面:
<template><view>{{title}}</view></template><script>export default {data() {return {title:''}},//页面加载onLoad(e) {console.log("page onLoad");console.log(e);this.title=e.id;},//页面渲染完成onReady() {console.log("page onReady");},//页面显示onShow() {console.log("page onShow");},//页面隐藏onHide() {console.log("page onHide");},//页面卸载onUnload() {console.log("page onUnload");},methods: {}}</script><style></style>

