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__
/
pages
/
AsyncSetup
/
AsyncSetup.ts
20 lines
(15 loc)
•
300 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import
{
PageWithSetupForTesting
}
from
'@tests/utils/convertingPageToComponent'
PageWithSetupForTesting
({
data
: {
count
:
0
, },
async
setup
(
) {
const
count =
await
getCount
()
return
() =>
({ count, }) }, })
async
function
getCount
(
) {
return
1
}