From 11c44155369553b6b46cd648e030281f4acc59b8 Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Sat, 19 Oct 2019 12:56:06 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E4=BF=AE=E6=94=B9uni.$off=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/api/window/communication.md | 63 +++++++++++++++++++++++-- docs/collocation/frame/communication.md | 63 +++++++++++++++++++++++-- 2 files changed, 118 insertions(+), 8 deletions(-) diff --git a/docs/api/window/communication.md b/docs/api/window/communication.md index 014c79821..1eb29b07b 100644 --- a/docs/api/window/communication.md +++ b/docs/api/window/communication.md @@ -66,10 +66,65 @@ - 提供的回调必须跟$on的回调为同一个才能移除这个回调的监听器; **代码示例** -```javascript - uni.$off('update',function(data){ - console.log('移除 update 自定义事件'); - }) + +`$emit`、`$on`、`$off`常用于跨页面、跨组件通讯,这里为了方便演示放在同一个页面 + +```html + + + + + + ``` diff --git a/docs/collocation/frame/communication.md b/docs/collocation/frame/communication.md index 014c79821..1eb29b07b 100644 --- a/docs/collocation/frame/communication.md +++ b/docs/collocation/frame/communication.md @@ -66,10 +66,65 @@ - 提供的回调必须跟$on的回调为同一个才能移除这个回调的监听器; **代码示例** -```javascript - uni.$off('update',function(data){ - console.log('移除 update 自定义事件'); - }) + +`$emit`、`$on`、`$off`常用于跨页面、跨组件通讯,这里为了方便演示放在同一个页面 + +```html + + + + + + ``` -- GitLab