-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.wpy
50 lines (49 loc) · 937 Bytes
/
test.wpy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<template>
<view class="container">
{{obj.list.length}}
{{objList.length}}
{{objListLength}}
/
{{pureList.length}}
{{pureListLength}}
/
{{listObj[0].list.length}}
{{listObjList.length}}
<button @tap="test">test</button>
</view>
</template>
<script>
import wepy from 'wepy'
export default class Test extends wepy.page {
data = {
obj: {
list: []
},
listObj: [{
list: []
}],
pureList: []
}
computed = {
objListLength () {
return this.obj.list.length
},
objList () {
return this.obj.list
},
pureListLength () {
return this.pureList.length
},
listObjList () {
return this.listObj[0].list
}
}
methods = {
test () {
this.obj.list.push(1)
this.pureList.push(1)
this.listObj[0].list.push(1)
}
}
}
</script>