Skip to content

Commit

Permalink
add spinnerClass
Browse files Browse the repository at this point in the history
  • Loading branch information
alex1504 committed Feb 15, 2017
1 parent 1e32d2a commit 8af9c56
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 35 deletions.
45 changes: 27 additions & 18 deletions build/build.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/build.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"css-loader": "^0.25.0",
"file-loader": "^0.9.0",
"mockjs": "^1.0.1-beta3",
"node-sass": "^4.2.0",
"node-sass": "^4.5.0",
"sass": "^0.5.0",
"sass-loader": "^4.0.0",
"style-loader": "^0.13.1",
Expand Down
6 changes: 4 additions & 2 deletions src/components/book/book.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<md-divider class="md-inset"></md-divider>
</md-list-item>
</md-list>
<md-spinner :md-size="60" md-indeterminate v-show='flag'></md-spinner>
<md-spinner :class="spinnerClass" :md-size="60" md-indeterminate v-show='flag'></md-spinner>
</div>

</template>
Expand All @@ -43,7 +43,9 @@ export default {
}
},
computed:{
spinnerClass(){
return this.$store.getters.SPINNER_CLASS
}
},
mounted:function(){
this.loadMore()
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default {
},
computed: {
theme(){
return this.$store.getters.theme
return this.$store.getters.THEME_COLOR
},
activeRoute(){
return this.$store.state.activeRoute;
Expand Down
7 changes: 6 additions & 1 deletion src/components/movie/movie_list_coming.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<md-divider class="md-inset"></md-divider>
</md-list-item>
</md-list>
<md-spinner :md-size="60" md-indeterminate v-show='spinnerFlag'></md-spinner>
<md-spinner :class="spinnerClass" :md-size="60" md-indeterminate v-show='spinnerFlag'></md-spinner>
</div>
</div>

Expand All @@ -37,6 +37,11 @@ export default {
busy: false
}
},
computed:{
spinnerClass(){
return this.$store.getters.SPINNER_CLASS
}
},
mounted:function(){
this.scrContainer = this.$el;
this.scrContent = this.$el.querySelector(".j-content")
Expand Down
7 changes: 6 additions & 1 deletion src/components/movie/movie_list_hot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<md-divider class="md-inset"></md-divider>
</md-list-item>
</md-list>
<md-spinner :md-size="60" md-indeterminate v-show='spinnerFlag'></md-spinner>
<md-spinner :class="spinnerClass" :md-size="60" md-indeterminate v-show='spinnerFlag'></md-spinner>
</div>
</div>

Expand All @@ -37,6 +37,11 @@ export default {
busy: false
}
},
computed:{
spinnerClass(){
return this.$store.getters.SPINNER_CLASS
}
},
mounted:function(){
this.scrContainer = this.$el;
this.scrContent = this.$el.querySelector(".j-content")
Expand Down
7 changes: 6 additions & 1 deletion src/components/movie/movie_list_top250.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<md-divider class="md-inset"></md-divider>
</md-list-item>
</md-list>
<md-spinner :md-size="60" md-indeterminate v-show='spinnerFlag'></md-spinner>
<md-spinner :class="spinnerClass" :md-size="60" md-indeterminate v-show='spinnerFlag'></md-spinner>
</div>
</div>

Expand All @@ -37,6 +37,11 @@ export default {
busy: false
}
},
computed:{
spinnerClass(){
return this.$store.getters.SPINNER_CLASS
}
},
mounted:function(){
this.scrContainer = this.$el;
this.scrContent = this.$el.querySelector(".j-content")
Expand Down
6 changes: 4 additions & 2 deletions src/components/music/music.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</md-list>


<md-spinner class="md-theme-teal" :md-size="60" md-indeterminate v-show='spinnerFlag'></md-spinner>
<md-spinner :class="spinnerClass" :md-size="60" md-indeterminate v-show='spinnerFlag'></md-spinner>
</div>

</template>
Expand Down Expand Up @@ -67,7 +67,9 @@ export default {
};
},
computed:{
spinnerClass(){
return this.$store.getters.SPINNER_CLASS
}
},
mounted:function(){
axios.get(API_PROXY+'http://music.163.com/api/playlist/detail?id=98833242')
Expand Down
7 changes: 6 additions & 1 deletion src/components/photo/photo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</div>
</transition>
</div>
<md-spinner :md-size="60" md-indeterminate v-show="spinnerFlag"></md-spinner>
<md-spinner :class="spinnerClass" :md-size="60" md-indeterminate v-show="spinnerFlag"></md-spinner>
</div>
</div>

Expand All @@ -28,6 +28,11 @@ export default {
page:1
}
},
computed:{
spinnerClass(){
return this.$store.getters.SPINNER_CLASS
}
},
mounted:function(){
this.loadMore().then(function(){
this.loadMore()
Expand Down
8 changes: 4 additions & 4 deletions src/store/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const store = new Vuex.Store({
activeRoute: 'movie'
},
getters: {
theme(state){
[types.THEME](state){
var mapTheme = {
"movie": 'blue',
'movie-detail': 'blue',
Expand All @@ -19,12 +19,12 @@ const store = new Vuex.Store({
'photo-detail': 'indigo'
}
return mapTheme[state.activeRoute]
},
[types.SPINNERCLASS](state,getters){
return "md-theme-"+getters[[types.THEME]]
}
},
mutations:{
[types.THEME_CHANGE](state,payload){
state.theme = payload.theme
},
[types.ROUTE_CHANGE](state,payload){
state.activeRoute = payload.activeRoute
},
Expand Down
4 changes: 2 additions & 2 deletions src/store/types.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*Getters Type*/

export const THEME = 'THEME_COLOR'
export const SPINNERCLASS = 'SPINNER_CLASS'
/*Actions Type*/

/*Mutations Type*/
export const THEME_CHANGE = 'THEME_CHANGE'
export const ROUTE_CHANGE = 'ROUTE_CHANGE'
export const LOGIN_CHANGE = 'LOGIN_CHANGE'

0 comments on commit 8af9c56

Please sign in to comment.