From a6ed14e0ac3c24cd44c2841bb28a275df2ba3337 Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Thu, 22 Oct 2020 20:04:12 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20data=E5=BA=94=E4=B8=BAfunction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/api/media/record-manager.md | 8 +++++--- docs/api/media/video.md | 12 ++++++++---- docs/api/ui/animation.md | 6 ++++-- docs/api/ui/pulldown.md | 6 ++++-- docs/component/barcode.md | 6 ++++-- docs/component/live-pusher.md | 4 ++-- docs/use-weex.md | 6 ++++-- 7 files changed, 31 insertions(+), 17 deletions(-) diff --git a/docs/api/media/record-manager.md b/docs/api/media/record-manager.md index 1c90900eba..801473037c 100644 --- a/docs/api/media/record-manager.md +++ b/docs/api/media/record-manager.md @@ -89,9 +89,11 @@ const innerAudioContext = uni.createInnerAudioContext(); innerAudioContext.autoplay = true; export default { - data: { - text: 'uni-app', - voicePath: '' + data() { + return { + text: 'uni-app', + voicePath: '' + } }, onLoad() { let self = this; diff --git a/docs/api/media/video.md b/docs/api/media/video.md index e732a1f352..4d837b1e54 100644 --- a/docs/api/media/video.md +++ b/docs/api/media/video.md @@ -51,8 +51,10 @@ ``` ```javascript export default { - data: { - src: '' + data() { + return { + src: '' + } }, methods: { test: function () { @@ -195,8 +197,10 @@ uni.chooseMedia({ ``` ```javascript export default { - data: { - src: '' + data() { + return { + src: '' + } }, methods: { test: function () { diff --git a/docs/api/ui/animation.md b/docs/api/ui/animation.md index 5eac166e2d..abf461c64a 100644 --- a/docs/api/ui/animation.md +++ b/docs/api/ui/animation.md @@ -120,8 +120,10 @@ var animation = uni.createAnimation({ ```javascript export default{ - data: { - animationData: {} + data() { + return { + animationData: {} + } }, onShow: function(){ var animation = uni.createAnimation({ diff --git a/docs/api/ui/pulldown.md b/docs/api/ui/pulldown.md index 166a923378..4418863fd5 100644 --- a/docs/api/ui/pulldown.md +++ b/docs/api/ui/pulldown.md @@ -51,8 +51,10 @@ index.vue ```javascript // 仅做示例,实际开发中延时根据需求来使用。 export default { - data: { - text: 'uni-app' + data() { + return { + text: 'uni-app' + } }, onLoad: function (options) { setTimeout(function () { diff --git a/docs/component/barcode.md b/docs/component/barcode.md index 274d2fa15a..328afda644 100644 --- a/docs/component/barcode.md +++ b/docs/component/barcode.md @@ -104,8 +104,10 @@ message|string|失败描述 onLoad() { }, - data: { - fil: [0, 2, 1] + data() { + return { + fil: [0, 2, 1] + } }, methods: { diff --git a/docs/component/live-pusher.md b/docs/component/live-pusher.md index 7d8ea022ca..02274f223a 100644 --- a/docs/component/live-pusher.md +++ b/docs/component/live-pusher.md @@ -138,8 +138,8 @@ message|string| 具体的网络状态信息 ```javascript