Skip to content

Commit 1aeb8a4

Browse files
committed
Modify all the constants from camel case to uppper case
1 parent 079a95a commit 1aeb8a4

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/components/InfiniteLoading.vue

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
<script>
1717
/* eslint-disable no-console */
1818
19-
const spinnerMapping = {
20-
bubbles: 'loading-bubbles',
21-
circles: 'loading-circles',
22-
default: 'loading-default',
23-
spiral: 'loading-spiral',
24-
waveDots: 'loading-wave-dots',
19+
const SPINNERS = {
20+
BUBBLES: 'loading-bubbles',
21+
CIRCLES: 'loading-circles',
22+
DEFAULT: 'loading-default',
23+
SPIRAL: 'loading-spiral',
24+
WAVEDOTS: 'loading-wave-dots',
2525
};
26-
const warnings = {
27-
stateChanger: [
26+
const WARNINGS = {
27+
STATE_CHANGER: [
2828
'[Vue-infinite-loading warn]: emit `loaded` and `complete` event through component instance of `$refs` may cause error, so it will be deprecated soon, please use the `$state` argument instead (`$state` just the special `$event` variable):',
2929
'\ntemplate:',
3030
'<infinite-loading @infinite="infiniteHandler"></infinite-loading>',
@@ -45,7 +45,7 @@
4545
'',
4646
'more details: https://github.com/PeachScript/vue-infinite-loading/issues/57#issuecomment-324370549',
4747
].join('\n'),
48-
infiniteEvent: '[Vue-infinite-loading warn]: `:on-infinite` property will be deprecated soon, please use `@infinite` event instead.',
48+
INFINITE_EVENT: '[Vue-infinite-loading warn]: `:on-infinite` property will be deprecated soon, please use `@infinite` event instead.',
4949
};
5050
5151
export default {
@@ -62,7 +62,7 @@
6262
},
6363
computed: {
6464
spinnerType() {
65-
return spinnerMapping[this.spinner] || spinnerMapping.default;
65+
return SPINNERS[(this.spinner || '').toUpperCase()] || SPINNERS.DEFAULT;
6666
},
6767
isNoResults: {
6868
cache: false, // disable cache to fix the problem of get slot text delay
@@ -121,7 +121,7 @@
121121
}
122122
123123
if (!ev || ev.target !== this) {
124-
console.warn(warnings.stateChanger);
124+
console.warn(WARNINGS.STATE_CHANGER);
125125
}
126126
});
127127
@@ -137,7 +137,7 @@
137137
this.scrollParent.removeEventListener('scroll', this.scrollHandler);
138138
139139
if (!ev || ev.target !== this) {
140-
console.warn(warnings.stateChanger);
140+
console.warn(WARNINGS.STATE_CHANGER);
141141
}
142142
});
143143
@@ -150,7 +150,7 @@
150150
});
151151
152152
if (this.onInfinite) {
153-
console.warn(warnings.infiniteEvent);
153+
console.warn(WARNINGS.INFINITE_EVENT);
154154
}
155155
156156
/**

0 commit comments

Comments
 (0)