未验证 提交 a9d496da 编写于 作者: F fasttian 提交者: Gitee

update

上级 d1c73481
...@@ -304,43 +304,42 @@ ...@@ -304,43 +304,42 @@
```js ```js
// 方式一:在 B 页面 <script setup> 中 // 方式一:在 B 页面 <script setup> 中
<script setup> <script setup>
import { import {
onLoad, onLoad,
onShow onShow
} from "@dcloudio/uni-app"; } from "@dcloudio/uni-app";
// onLoad 接受 A 页面传递的参数 // onLoad 接受 A 页面传递的参数
onLoad((option) => { onLoad((option) => {
console.log("B 页面 onLoad:", option); //B 页面 onLoad: {id: '1', name: 'uniapp'} console.log("B 页面 onLoad:", option); //B 页面 onLoad: {id: '1', name: 'uniapp'}
}); });
onShow(() => { onShow(() => {
console.log("B 页面 onShow"); console.log("B 页面 onShow");
}); });
</script> </script>
``` ```
```js ```js
// 方式二:在 B 页面 setup() 中 // 方式二:在 B 页面 setup() 中
<script> <script>
import { import {
onLoad, onLoad,
onShow, onShow,
} from "@dcloudio/uni-app"; } from "@dcloudio/uni-app";
export default { export default {
setup() { setup() {
// onLoad 接受 A 页面传递的参数 // onLoad 接受 A 页面传递的参数
onLoad((option) => { onLoad((option) => {
console.log("B 页面 onLoad:", option); //B 页面 onLoad: {id: '1', name: 'uniapp'} console.log("B 页面 onLoad:", option); //B 页面 onLoad: {id: '1', name: 'uniapp'}
}); });
onShow(() => { onShow(() => {
console.log("B 页面 onShow"); console.log("B 页面 onShow");
}); });
}
} }
}
</script> </script>
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册