9
9
false;
10
10
11
11
// 接口参数、回调或者返回值
12
+ true;
12
13
false;
13
14
false;
14
15
false;
15
16
false;
16
- false;
17
- false;
17
+ true;
18
18
19
19
// 组件的属性
20
20
true;
@@ -42,34 +42,34 @@ Taro.noop();"
42
42
` ;
43
43
44
44
exports [` babel-plugin-transform-taroapi should not go wrong when using an api twice 1` ] = `
45
- "import Taro from '@tarojs/taro-h5';
46
- const animation = Taro.createAnimation ({
45
+ "import Taro, { createAnimation as _createAnimation } from '@tarojs/taro-h5';
46
+ const animation = _createAnimation ({
47
47
duration : dura * 1000 ,
48
48
timingFunction : ' linear'
49
49
} );
50
- const resetAnimation = Taro.createAnimation ({
50
+ const resetAnimation = _createAnimation ({
51
51
duration : 0 ,
52
52
timingFunction : ' linear'
53
53
} );"
54
54
` ;
55
55
56
56
exports [` babel-plugin-transform-taroapi should not import taro duplicity 1` ] = `
57
- "import Taro from '@tarojs/taro-h5';
57
+ "import Taro, { createAnimation as _createAnimation , initPxTransform as _initPxTransform } from '@tarojs/taro-h5';
58
58
Taro.Component;
59
- Taro.createAnimation ();
60
- Taro.initPxTransform ();"
59
+ _createAnimation ();
60
+ _initPxTransform ();"
61
61
` ;
62
62
63
63
exports [` babel-plugin-transform-taroapi should preserve assignments in left hands 1` ] = `
64
- "import Taro from '@tarojs/taro-h5';
64
+ "import Taro, { createAnimation as _createAnimation , request as _request } from '@tarojs/taro-h5';
65
65
let animation;
66
- animation = Taro.createAnimation ({
66
+ animation = _createAnimation ({
67
67
transformOrigin : " 50% 50%" ,
68
68
duration : 1000 ,
69
69
timingFunction : " ease" ,
70
70
delay : 0
71
71
} );
72
- Taro.request ();
72
+ _request ();
73
73
Taro.request = '';
74
74
Taro['request'] = '';"
75
75
` ;
@@ -86,11 +86,11 @@ export class Connected extends Taro.Component {}"
86
86
` ;
87
87
88
88
exports [` babel-plugin-transform-taroapi should work! 1` ] = `
89
- "import Taro from '@tarojs/taro-h5';
90
- Taro.initPxTransform (Taro.param);
91
- Taro.initPxTransform ();
92
- Taro.initPxTransform ();
93
- Taro['getStorage'] ();
94
- Taro.setStorage ();
89
+ "import Taro, { setStorage as _setStorage , initPxTransform as _initPxTransform , getStorage as _getStorage } from '@tarojs/taro-h5';
90
+ _initPxTransform (Taro.param);
91
+ _initPxTransform ();
92
+ _initPxTransform ();
93
+ _getStorage ();
94
+ _setStorage ();
95
95
export { Taro } ;"
96
96
` ;
0 commit comments