UNPKG
miniprogram-setup
Version:
latest (0.1.4)
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
小程序支持 setup 选项
github.com/zhangzhonghe/miniprogram-lifecycle
zhangzhonghe/miniprogram-lifecycle
miniprogram-setup
/
__tests__
/
components
/
Counter
/
Counter.ts
17 lines
(13 loc)
•
230 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import
{
ComponentWithSetup
}
from
'@/index'
ComponentWithSetup
({
setup
(
) {
let
count =
0
const
increment
= (
) => { count++ }
return
() =>
({ count, increment, }) }, })