4
0
mirror of https://github.com/AzuraCast/AzuraCast.git synced 2024-06-14 13:16:37 +00:00

Use pickProps for prop-drilling in other components.

This commit is contained in:
Buster Neece 2023-01-04 11:54:37 -06:00
parent c34c1fb16f
commit 1fa0ab618b
No known key found for this signature in database
GPG Key ID: F1D2E64A0005E80E
4 changed files with 45 additions and 13 deletions

View File

@ -8,7 +8,7 @@
<div class="stations nowplaying"> <div class="stations nowplaying">
<radio-player <radio-player
v-bind="$props" v-bind="pickProps(props, playerProps)"
@np_updated="onNowPlayingUpdate" @np_updated="onNowPlayingUpdate"
/> />
</div> </div>
@ -59,6 +59,7 @@ import Icon from '~/components/Common/Icon';
import RadioPlayer from './Player.vue'; import RadioPlayer from './Player.vue';
import {ref} from "vue"; import {ref} from "vue";
import playerProps from "~/components/Public/playerProps"; import playerProps from "~/components/Public/playerProps";
import {pickProps} from "~/functions/pickProps";
const props = defineProps({ const props = defineProps({
...playerProps, ...playerProps,

View File

@ -1,13 +1,13 @@
<template> <template>
<episodes-view <episodes-view
v-if="activePodcast" v-if="activePodcast"
v-bind="$props" v-bind="pickProps(props, episodesViewProps)"
:podcast="activePodcast" :podcast="activePodcast"
@clear-podcast="onClearPodcast" @clear-podcast="onClearPodcast"
/> />
<list-view <list-view
v-else v-else
v-bind="$props" v-bind="pickProps(props, listViewProps)"
@select-podcast="onSelectPodcast" @select-podcast="onSelectPodcast"
/> />
</template> </template>
@ -18,6 +18,7 @@ import ListView from './Podcasts/ListView';
import {ref} from "vue"; import {ref} from "vue";
import episodesViewProps from "./Podcasts/episodesViewProps"; import episodesViewProps from "./Podcasts/episodesViewProps";
import listViewProps from "./Podcasts/listViewProps"; import listViewProps from "./Podcasts/listViewProps";
import {pickProps} from "~/functions/pickProps";
const props = defineProps({ const props = defineProps({
...episodesViewProps, ...episodesViewProps,

View File

@ -1,5 +1,14 @@
export default { export default {
locale: String, locale: {
stationTimeZone: String, type: String,
quotaUrl: String required: true
},
stationTimeZone: {
type: String,
required: true
},
quotaUrl: {
type: String,
required: true
}
} }

View File

@ -1,9 +1,30 @@
export default { export default {
listUrl: String, listUrl: {
newArtUrl: String, type: String,
quotaUrl: String, required: true
locale: String, },
stationTimeZone: String, newArtUrl: {
languageOptions: Object, type: String,
categoriesOptions: Object required: true
},
quotaUrl: {
type: String,
required: true
},
locale: {
type: String,
required: true
},
stationTimeZone: {
type: String,
required: true
},
languageOptions: {
type: Object,
required: true
},
categoriesOptions: {
type: Object,
required: true
}
} }