mirror of
https://github.com/koel/koel
synced 2024-11-10 14:44:13 +00:00
feat: use type for screen header layout
This commit is contained in:
parent
47dc2a5744
commit
5ecfc89aa6
3 changed files with 3 additions and 2 deletions
|
@ -20,7 +20,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
const props = withDefaults(defineProps<{ layout?: 'expanded' | 'collapsed' }>(), { layout: 'expanded' })
|
||||
const props = withDefaults(defineProps<{ layout?: ScreenHeaderLayout }>(), { layout: 'expanded' })
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
|
|
@ -29,7 +29,7 @@ export const useSongList = (
|
|||
const isPhone = isMobile.phone
|
||||
const selectedSongs = ref<Song[]>([])
|
||||
const showingControls = ref(false)
|
||||
const headerLayout = ref<'expanded' | 'collapsed'>('expanded')
|
||||
const headerLayout = ref<ScreenHeaderLayout>('expanded')
|
||||
|
||||
const onScrollBreakpoint = (direction: 'up' | 'down') => {
|
||||
headerLayout.value = direction === 'down' ? 'collapsed' : 'expanded'
|
||||
|
|
1
resources/assets/js/types.d.ts
vendored
1
resources/assets/js/types.d.ts
vendored
|
@ -116,6 +116,7 @@ interface FileSystemEntry {
|
|||
}
|
||||
|
||||
type MediaInfoDisplayMode = 'aside' | 'full'
|
||||
type ScreenHeaderLayout = 'expanded' | 'collapsed'
|
||||
|
||||
interface AlbumTrack {
|
||||
readonly title: string
|
||||
|
|
Loading…
Reference in a new issue