Skip to content
This repository was archived by the owner on Jun 3, 2021. It is now read-only.

Commit b322c2c

Browse files
committed
format
1 parent 72c0ef3 commit b322c2c

File tree

28 files changed

+92
-42
lines changed

28 files changed

+92
-42
lines changed

example/cell/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
import entry from './index.vue'
2+
23
entry.el = '#root'
34
export default new Vue(entry)

example/grid-select/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
import entry from './index.vue'
2+
23
entry.el = '#root'
34
export default new Vue(entry)

example/grid-select/index.vue

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
import Title from '../_mods/title.vue';
8383
import Category from '../_mods/category.vue';
8484
import { setTitle } from '../_mods/set-nav';
85+
8586
const modal = weex.requireModule('modal');
8687
8788
export default {

example/lottery-rain/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
import entry from './index.vue'
2+
23
entry.el = '#root'
34
export default new Vue(entry)

packages/wxc-button/index.vue

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
<script>
1313
import { STYLE_MAP, TEXT_STYLE_MAP } from './type'
14+
1415
export default {
1516
props: {
1617
text: {

packages/wxc-cell/index.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898

9999
<script>
100100
import Utils from './utils';
101+
101102
export default {
102103
props: {
103104
label: {
@@ -132,9 +133,9 @@
132133
type: Boolean,
133134
default: false
134135
},
135-
arrowIcon:{
136-
type:String,
137-
default:'//gw.alicdn.com/tfs/TB11zBUpwMPMeJjy1XbXXcwxVXa-22-22.png'
136+
arrowIcon: {
137+
type: String,
138+
default: '//gw.alicdn.com/tfs/TB11zBUpwMPMeJjy1XbXXcwxVXa-22-22.png'
138139
},
139140
hasVerticalIndent: {
140141
type: Boolean,

packages/wxc-checkbox-list/index.vue

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
<script>
1818
import WxcCheckbox from '../wxc-checkbox/index.vue';
19+
1920
export default {
2021
components: { WxcCheckbox },
2122
props: {

packages/wxc-checkbox/checkboxList.vue

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
<script>
1212
import WxcCheckbox from './index.vue';
13+
1314
export default {
1415
components: { WxcCheckbox },
1516
props: {

packages/wxc-checkbox/index.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@
1818
width: 48px;
1919
height: 48px;
2020
}
21-
.title-text{
21+
22+
.title-text {
2223
font-size: 30px;
2324
}
2425
</style>
2526

2627
<script>
2728
import WxcCell from '../wxc-cell';
2829
import { CHECKED, UNCHECKED, CHECKED_DISABLED, UNCHECKED_DISABLED } from './type'
30+
2931
export default {
3032
components: { WxcCell },
3133
props: {

packages/wxc-dialog/index.vue

+1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124

125125
<script>
126126
import { CHECKED, UN_CHECKED } from './type';
127+
127128
export default {
128129
props: {
129130
show: {

packages/wxc-indexlist/index.vue

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
<script>
6363
const dom = weex.requireModule('dom');
6464
import * as Utils from './utils'
65+
6566
export default {
6667
props: {
6768
height: {

packages/wxc-loading/index.vue

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
<script>
6161
import { PNG, GIF, BLACK_GIF } from './type';
6262
import * as Utils from './utils';
63+
6364
const appVersion = weex.config.env.appVersion || '0';
6465
const needShowPng = Utils.compareVersion('8.2.4', appVersion) && Utils.isTrip() && Utils.isAndroid();
6566
export default {

packages/wxc-loading/part.vue

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
<script>
1616
import { PART } from './type';
17+
1718
export default {
1819
props: {
1920
show: {

packages/wxc-lottery-rain/libs/animate.js

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
const animation = weex.requireModule('animation');
77
import * as Utils from './utils';
8+
89
const isIos = Utils.isIOS();
910

1011
export function showPig (ref, duration, callback) {

packages/wxc-page-calendar/index.vue

+2
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@
4848

4949
<script>
5050
import * as Utils from './utils';
51+
5152
const dom = weex.requireModule('dom');
5253
const animation = weex.requireModule('animation');
5354

5455
import WxcMinibar from '../wxc-minibar'
56+
5557
export default {
5658
components: { WxcMinibar },
5759
props: {

packages/wxc-part-loading/index.vue

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
<script>
1717
import { PART } from '../wxc-loading/type';
18+
1819
export default {
1920
props: {
2021
show: {

packages/wxc-popup/index.vue

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
const { platform } = weex.config.env;
5757
const isWeb = typeof (window) === 'object' && platform.toLowerCase() === 'web';
5858
import WxcOverlay from '../wxc-overlay';
59+
5960
export default {
6061
components: { WxcOverlay },
6162
props: {

packages/wxc-radio/index.vue

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
<script>
1818
import wxcRadio from './item.vue';
19+
1920
export default {
2021
components: { wxcRadio },
2122
props: {

packages/wxc-result/index.vue

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484

8585
<script>
8686
import * as TYPES from './type'
87+
8788
export default {
8889
props: {
8990
type: {

packages/wxc-rich-text/index.vue

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050

5151
<script>
5252
import Utils from './utils';
53+
5354
export default {
5455
components: {
5556
WxcRichTextText: require('./wxc-rich-text-text.vue'),

packages/wxc-rich-text/utils.js

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Created by Tw93 on 2017/6/26.
33
*/
44
import UrlParser from 'url-parse';
5+
56
const Utils = {
67
UrlParser: UrlParser,
78
/**

packages/wxc-rich-text/wxc-rich-text-link.vue

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<script>
1515
const Utils = require('./utils');
1616
import WxcRichTextText from './wxc-rich-text-text.vue'
17+
1718
export default {
1819
components: { WxcRichTextText },
1920
props: {

packages/wxc-simple-flow/index.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
<div class="point" :class="item.__pointClass__" :style="item.__pointStyle__"></div>
1010

11-
<text class="text-title full-rest" :class="item.__titleTextClass__" :style="item.__titleStyle__">{{item.title}}</text>
11+
<text class="text-title full-rest" :class="item.__titleTextClass__"
12+
:style="item.__titleStyle__">{{item.title}}</text>
1213
</div>
1314

1415
<div class="content flex-row" :class="item.__contentClass__">

packages/wxc-slide-nav/index.vue

+38-26
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121
const OFFSET_ACCURACY = 10;
2222
const SCALE = weex.config.env.platform.toLowerCase() === 'web' ? 2 : 1;
2323

24-
function _toNum(str) {
24+
function _toNum (str) {
2525
return typeof str === 'number' ? str : parseFloat((str || '').replace(/px$/i, ''));
2626
}
2727

28-
function _getHeight(element, callback) {
29-
if (!element) { return; }
28+
function _getHeight (element, callback) {
29+
if (!element) {
30+
return;
31+
}
3032
if (element.__cacheHeight) {
3133
element.__cacheHeight && callback && callback(element.__cacheHeight);
3234
} else {
@@ -48,27 +50,27 @@
4850
height: [String, Number]
4951
},
5052

51-
data() {
53+
data () {
5254
return {
5355
visible: true
5456
}
5557
},
5658

5759
watch: {
58-
visible(newVal) {
60+
visible (newVal) {
5961
newVal ? this._slideIn() : this._slideOut();
6062
}
6163
},
6264

63-
created() {
65+
created () {
6466
this._height = _toNum(this.height) || 0;
6567
this._isBottom = this.position === 'bottom';
6668
this._direction = this._isBottom ? 1 : -1;
6769
},
6870

6971
methods: {
7072

71-
_slideOut() {
73+
_slideOut () {
7274
this.getHeight((height) => {
7375
this.$emit('slideOut');
7476
this.slideY(height * this._direction * SCALE, () => {
@@ -77,7 +79,7 @@
7779
});
7880
},
7981

80-
_slideIn() {
82+
_slideIn () {
8183
this.getHeight((height) => {
8284
this.$emit('slideIn');
8385
this.slideY(0, () => {
@@ -86,29 +88,29 @@
8688
});
8789
},
8890

89-
getHeight(callback) {
91+
getHeight (callback) {
9092
return _getHeight(this.$refs.wrapper, callback);
9193
},
9294

93-
slideOut() {
95+
slideOut () {
9496
this.visible = false;
9597
},
9698

97-
slideIn() {
99+
slideIn () {
98100
this.visible = true;
99101
},
100102

101-
slideY(y, callback) {
103+
slideY (y, callback) {
102104
Animation.transition(this.$refs.wrapper, {
103-
styles: { transform: 'translateY(' + y + 'px)' },
105+
styles: { transform: 'translateY(' + y + 'px)' },
104106
duration: 150, //ms
105107
timingFunction: 'ease',
106108
delay: 0 //ms
107109
}, callback);
108110
}
109111
},
110112

111-
handleTouchStart(e) {
113+
handleTouchStart (e) {
112114
let touch = e.changedTouches[0];
113115
this._touchParams = {
114116
pageY: touch.screenY,
@@ -119,7 +121,7 @@
119121
};
120122
},
121123

122-
handleTouchMove(e, bottomNav) {
124+
handleTouchMove (e, bottomNav) {
123125
let tp = this._touchParams;
124126
let touch = e.changedTouches[0];
125127
let offsetY;
@@ -157,34 +159,40 @@
157159
}
158160
},
159161

160-
handleTouchEnd() {
162+
handleTouchEnd () {
161163
let tp = this._touchParams;
162164
tp && (tp.hasEnd = true);
163165
},
164166

165-
handleScroll(e, scroller, topNav, bottomNav, startThreshold, moveThreshold = 5) {
167+
handleScroll (e, scroller, topNav, bottomNav, startThreshold, moveThreshold = 5) {
166168
let scrollY = e.contentOffset.y;
167169
let nav = topNav || bottomNav;
168170
let scrollFn = (maxScrollY) => {
169-
if (-scrollY > maxScrollY) { return; }
171+
if (-scrollY > maxScrollY) {
172+
return;
173+
}
170174
maxScrollY = Math.abs(maxScrollY);
171175
if (Math.abs(scrollY) < startThreshold) {
172176
if (Math.abs(scrollY) >= maxScrollY - OFFSET_ACCURACY) {
173177
let tp = this._touchParams;
174-
if (!tp) { return; }
178+
if (!tp) {
179+
return;
180+
}
175181
let offsetY = tp.offsetY;
176-
if (offsetY < -OFFSET_ACCURACY) {
177-
bottomNav && bottomNav.slideOut();
178-
} else if (offsetY > OFFSET_ACCURACY) {
179-
bottomNav && bottomNav.slideIn();
182+
if (offsetY < -OFFSET_ACCURACY) {
183+
bottomNav && bottomNav.slideOut();
184+
} else if (offsetY > OFFSET_ACCURACY) {
185+
bottomNav && bottomNav.slideIn();
180186
}
181187
} else {
182188
topNav && topNav.slideIn();
183189
bottomNav && bottomNav.slideIn();
184190
}
185191
} else {
186192
let tp = this._touchParams;
187-
if (!tp) { return; }
193+
if (!tp) {
194+
return;
195+
}
188196
let offsetY = tp.offsetY;
189197
if (Math.abs(offsetY) >= moveThreshold) {
190198
if (offsetY > 0) {
@@ -199,7 +207,9 @@
199207
};
200208

201209
let maxScrollYCheck = (maxScrollY) => {
202-
if (!this.__scrollable) { return; }
210+
if (!this.__scrollable) {
211+
return;
212+
}
203213
if (startThreshold) {
204214
scrollFn(maxScrollY);
205215
} else {
@@ -210,7 +220,9 @@
210220
}
211221
};
212222

213-
if (!nav) { return; }
223+
if (!nav) {
224+
return;
225+
}
214226

215227
_getHeight(scroller, (scrollerHeight) => {
216228
let maxScrollY = e.contentSize.height - scrollerHeight;

0 commit comments

Comments
 (0)