Skip to content

Commit 917f184

Browse files
committed
Add scoped attribute for the styles of infinite loading component
1 parent 65085cf commit 917f184

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/components/InfiniteLoading.vue

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<template>
2-
<div class="infinite-loading-container"
3-
:class="{
4-
hidden: !isLoading
5-
}">
6-
<i class="icon-loading"></i>
2+
<div class="infinite-loading-container">
3+
<i class="icon-loading" v-show="isLoading"></i>
74
</div>
85
</template>
96
<script>
@@ -52,7 +49,7 @@
5249
},
5350
ready() {
5451
if (this.distance === undefined) {
55-
this.$set('distance', 50);
52+
this.$set('distance', 100);
5653
}
5754
5855
scrollParent = getScrollParent(this.$el);
@@ -83,7 +80,7 @@
8380
},
8481
};
8582
</script>
86-
<style lang="less">
83+
<style lang="less" scoped>
8784
@font-face {font-family: "vue-infinite-loading";
8885
src: url('../assets/vue-infinite-loading.eot?t=1462930749'); /* IE9*/
8986
src: url('../assets/vue-infinite-loading.woff?t=1462930749') format('woff'), /* chrome, firefox */
@@ -101,22 +98,19 @@
10198
10299
.infinite-loading-container{
103100
clear: both;
104-
padding: 15px 0;
105-
min-height: 40px;
106101
text-align: center;
107102
*[class^=icon-]{
108103
@size: 30px;
109104
display: inline-block;
105+
margin: 15px 0;
110106
width: @size;
111107
height: @size;
112108
font-size: @size;
113109
line-height: @size;
114110
color: #999;
111+
border-radius: 50%;
115112
animation: ease loading 1.5s infinite;
116113
}
117-
&.hidden{
118-
display: none;
119-
}
120114
}
121115
122116
@keyframes loading {

0 commit comments

Comments
 (0)