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

76 lines
1.9 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>
2015-12-13 04:42:28 +00:00
</h1>
2015-12-13 04:42:28 +00:00
<div class="artists main-scroll-wrap" 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>
<!--
2015-12-13 04:42:28 +00:00
Add several more items to make sure the last row is left-aligned.
Credits: http://codepen.io/dalgard/pen/Dbnus
-->
2016-01-16 18:11:24 +00:00
<span class="item" v-for="n in 10"></span>
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 infiniteScroll from '../../../mixins/infinite-scroll';
import artistStore from '../../../stores/artist';
export default {
mixins: [infiniteScroll],
components: { artistItem },
data() {
return {
perPage: 9,
numOfItems: 9,
state: artistStore.state,
q: '',
};
},
computed: {
items() {
return this.state.artists;
},
},
events: {
/**
* When the application is ready, load the first batch of items.
*/
'koel:ready': function () {
this.displayMore();
},
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>