deemix-webui/src/components/TheContent.vue

81 lines
1.7 KiB
Vue
Raw Normal View History

2020-06-29 16:49:33 +00:00
<template>
<!-- <section id="content" @scroll="handleContentScroll" ref="content"> -->
<section id="content">
2020-06-29 16:49:33 +00:00
<div id="container">
<BaseLoadingPlaceholder id="search_placeholder" text="Searching..." :hidden="!loading" />
2020-07-28 19:39:44 +00:00
<router-view></router-view>
2020-06-29 16:49:33 +00:00
</div>
</section>
</template>
<style lang="scss">
#container {
margin: 0 auto;
max-width: 1280px;
width: var(--container-width);
}
#content {
background-color: var(--main-background);
width: 100%;
height: calc(100vh - 93px);
overflow-y: scroll;
overflow-x: hidden;
&::-webkit-scrollbar {
width: 10px;
}
&::-webkit-scrollbar-track {
background: var(--main-background);
}
2020-06-29 16:49:33 +00:00
&::-webkit-scrollbar-thumb {
background: var(--main-scroll);
border-radius: 4px;
width: 6px;
padding: 0px 2px;
}
}
</style>
2020-06-29 16:49:33 +00:00
<script>
import { debounce } from '@/utils/utils'
import EventBus from '@/utils/EventBus.js'
import BaseLoadingPlaceholder from '@components/BaseLoadingPlaceholder.vue'
2020-06-29 16:49:33 +00:00
export default {
components: {
BaseLoadingPlaceholder
},
data: () => ({
newScrolled: null,
loading: false
}),
mounted() {
this.$root.$on('updateSearchLoadingState', loading => {
console.log({ loading })
this.loading = loading
})
}
// methods: {
// handleContentScroll: debounce(async function () {
// if (this.$refs.content.scrollTop + this.$refs.content.clientHeight < this.$refs.content.scrollHeight) return
// if (
// main_selected !== 'search_tab' ||
// ['track_search', 'album_search', 'artist_search', 'playlist_search'].indexOf(window.search_selected) === -1
// ) {
// return
// }
// this.newScrolled = window.search_selected.split('_')[0]
// await this.$nextTick()
// this.newScrolled = null
// }, 100)
// }
2020-06-29 16:49:33 +00:00
}
</script>