From 1a9508aa2ae07e2a7590453603d99080cf4b44f7 Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Fri, 23 Aug 2019 18:55:50 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=9B=B4=E6=96=B0wxs=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/frame.md | 53 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/docs/frame.md b/docs/frame.md index b4fbe0383f..02e06bac41 100644 --- a/docs/frame.md +++ b/docs/frame.md @@ -925,12 +925,21 @@ WXS是微信小程序的一套脚本语言,[详见](https://developers.weixin. ``` - module.exports = { msg:'Hello', @@ -939,15 +948,42 @@ WXS是微信小程序的一套脚本语言,[详见](https://developers.weixin. }, propObserver: function(newValue, oldValue, ownerInstance, instance) { console.log('prop observer', newValue, oldValue) + }, + getMax: function(array){ + var max = undefined; + for (var i = 0; i < array.length; ++i) { + max = max === undefined ? + array[i] : + (max >= array[i] ? max : array[i]); + } + return max; } } + + export default { + msg: function(){ + return 'Hello'; + }, + getMax: function(array){ + var max = undefined; + for (var i = 0; i < array.length; ++i) { + max = max === undefined ? + array[i] : + (max >= array[i] ? max : array[i]); + } + return max; + } + }; + +