From 3652c86bb7fd6e3298e218e8b8c930143768e90f Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Wed, 31 Jul 2024 12:02:26 +0800 Subject: [PATCH] =?UTF-8?q?docs($emit=20setStorageSync):=20=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E5=8F=82=E6=95=B0=E4=B8=BA=E5=AF=B9=E8=B1=A1=E5=AD=97?= =?UTF-8?q?=E9=9D=A2=E9=87=8F=E9=9C=80=E8=A6=81=E6=98=8E=E7=A1=AE=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/api/event-bus.md | 8 ++++++++ docs/api/storage.md | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/docs/api/event-bus.md b/docs/api/event-bus.md index 732e40e5..4e608c3f 100644 --- a/docs/api/event-bus.md +++ b/docs/api/event-bus.md @@ -48,6 +48,14 @@ + +:::warning +参数 `args` 为对象字面量时,需要通过 `as UTSJSONObject` 明确类型,例如: +```js +uni.$emit('fn', {"a": 1} as UTSJSONObject) +``` +::: + diff --git a/docs/api/storage.md b/docs/api/storage.md index c6e9ce4f..ec1bbe52 100644 --- a/docs/api/storage.md +++ b/docs/api/storage.md @@ -37,6 +37,13 @@ uni-app的Storage在不同端的实现不同: +:::warning +参数 `data` 为对象字面量时,需要通过 `as UTSJSONObject` 明确类型,例如: +```js +uni.setStorageSync('obj', {"a": 1} as UTSJSONObject) +``` +::: + -- GitLab