Skip to content

Commit 753ac12

Browse files
committed
refactor: improve spinner render logic
1 parent 3e8c4d6 commit 753ac12

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/components/InfiniteLoading.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@ export default {
122122
type: Number,
123123
default: config.props.distance,
124124
},
125-
spinner: {
126-
type: String,
127-
},
125+
spinner: String,
128126
direction: {
129127
type: String,
130128
default: config.props.direction,

src/components/Spinner.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,8 @@ export default {
7070
computed: {
7171
spinnerView() {
7272
return (
73-
typeof this.$attrs.spinner === 'string'
74-
? SPINNERS[this.$attrs.spinner.toUpperCase()]
75-
: this.spinnerInConfig // fallback to spinner of config
73+
SPINNERS[(this.$attrs.spinner || '').toUpperCase()]
74+
|| this.spinnerInConfig // fallback to spinner of config
7675
);
7776
},
7877
spinnerInConfig() {

0 commit comments

Comments
 (0)