diff --git a/docs/frame.md b/docs/frame.md
index b4fbe0383fb930f88dbcaa8b5fa6fe6075046af0..02e06bac41a8f5c9678365c61917048eb0d78596 100644
--- a/docs/frame.md
+++ b/docs/frame.md
@@ -925,12 +925,21 @@ WXS是微信小程序的一套脚本语言,[详见](https://developers.weixin.
```
+
- {{test.msg}}
+
+
+ {{test.msg}}
+
+
+ {{test.msg()}}
+
+
+ {{test.getMax(array)}}
+
-
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;
+ }
+ };
+
+