update:24-07-09 17:22:32 -remark:添加新标签页传参相关笔记 -AutoCommit

This commit is contained in:
539943419 committed 2024-07-09 17:22:33 +08:00
1 parent 589e356f61
commit 2f2433af8a
2 files changed
+22 -6

No files matched your search

+21 -6
View File
@@ -48,6 +48,27 @@
{ leading: true, trailing: false }
)
```
然后就可以在项目中以如下方式进行调用:
```ts
const { goToSingReplay } = useAddTabsPage()
// 传参
goToSingReplay(data)
```
此处传递的参数可以通过以下过程在新页面进行接收
```ts
const initData = () => {
onHostMessage('onload', async (data: any) => {
// data即为传递过来的参数
...
})
}
// 必须在此生命周期进行
onMounted(async () => {
initData()
})
```
---
* apiFetch用法
@@ -95,12 +116,6 @@
// result结果会自动json解析,如{message:'success'...}
```
然后就可以在项目中以如下方式进行调用:
```ts
const { goToSingReplay } = useAddTabsPage()
// 传参
goToSingReplay(data)
```
---
* apiFetch之结果预处理: