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

72 lines
1.7 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="albumsWrapper">
2015-12-13 04:42:28 +00:00
<h1 class="heading">
2016-01-07 06:15:25 +00:00
<span>Albums</span>
2015-12-13 04:42:28 +00:00
</h1>
<div class="albums main-scroll-wrap" v-el:wrapper @scroll="scrolling">
<album-item v-for="item in items
2015-12-13 04:42:28 +00:00
| orderBy 'name'
| filterBy q in 'name' 'artist.name'
2015-12-13 04:42:28 +00:00
| limitBy numOfItems" :album="item"></album-item>
2016-03-24 09:18:43 +00:00
<span class="item" v-for="n in 6"></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 albumItem from '../../shared/album-item.vue';
import infiniteScroll from '../../../mixins/infinite-scroll';
import albumStore from '../../../stores/album';
2015-12-13 04:42:28 +00:00
export default {
mixins: [infiniteScroll],
components: { albumItem },
data() {
return {
perPage: 9,
numOfItems: 9,
state: albumStore.state,
q: '',
};
},
computed: {
items() {
return this.state.albums;
2015-12-13 04:42:28 +00:00
},
},
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
#albumsWrapper {
.albums {
@include artist-album-wrapper();
2015-12-13 04:42:28 +00:00
}
}
</style>