koel/resources/assets/js/components/main-wrapper/main-content/artists.vue

79 lines
2 KiB
Vue
Raw Normal View History

2015-12-13 04:42:28 +00:00
<template>
2016-01-06 10:57:45 +00:00
<section id="artistsWrapper">
2015-12-13 04:42:28 +00:00
<h1 class="heading">
2016-01-07 06:15:25 +00:00
<span>Artists</span>
2016-04-01 07:44:11 +00:00
<view-mode-switch :mode.sync="viewMode" for="artists"></view-mode-switch>
2015-12-13 04:42:28 +00:00
</h1>
<div class="artists main-scroll-wrap as-{{ viewMode }}" v-el:wrapper @scroll="scrolling">
<artist-item v-for="item in items
| filterBy q in 'name'
2015-12-13 04:42:28 +00:00
| limitBy numOfItems" :artist="item"></artist-item>
2016-03-24 09:18:43 +00:00
2016-03-31 04:05:07 +00:00
<span class="item filler" v-for="n in 6"></span>
<to-top-button :showing="showBackToTop"></to-top-button>
2015-12-13 04:42:28 +00:00
</div>
2016-01-06 10:57:45 +00:00
</section>
2015-12-13 04:42:28 +00:00
</template>
<script>
import artistItem from '../../shared/artist-item.vue';
import viewModeSwitch from '../../shared/view-mode-switch.vue';
2015-12-13 04:42:28 +00:00
import infiniteScroll from '../../../mixins/infinite-scroll';
import artistStore from '../../../stores/artist';
export default {
mixins: [infiniteScroll],
components: { artistItem, viewModeSwitch },
2015-12-13 04:42:28 +00:00
data() {
return {
perPage: 9,
numOfItems: 9,
state: artistStore.state,
q: '',
viewMode: null,
2015-12-13 04:42:28 +00:00
};
},
computed: {
items() {
return this.state.artists;
},
},
events: {
/**
* When the application is ready, load the first batch of items.
*/
'koel:ready': function () {
this.displayMore();
return true;
2015-12-13 04:42:28 +00:00
},
2015-12-30 04:14:47 +00:00
'koel:teardown': function () {
this.q = '';
this.numOfItems = 9;
},
2016-01-07 06:15:25 +00:00
'filter:changed': function (q) {
this.q = q;
},
2015-12-13 04:42:28 +00:00
},
};
</script>
<style lang="sass">
2016-03-13 17:00:32 +00:00
@import "../../../../sass/partials/_vars.scss";
@import "../../../../sass/partials/_mixins.scss";
2015-12-13 04:42:28 +00:00
#artistsWrapper {
.artists {
@include artist-album-wrapper();
2015-12-13 04:42:28 +00:00
}
}
</style>