0
0
Fork 0

Adjust how the items are being given to Vue

This commit is contained in:
Tyler-A 2020-08-05 22:41:41 -06:00
parent 601b684195
commit f5d3b6cb82

View file

@ -12,18 +12,12 @@
/>
<div v-if="error" class="error">{{ error }}</div>
<div v-else id="data_view">
<span
v-for="item in data"
<component
:is="config.type.slice(0, -1)"
v-for="item in items"
:key="item.uri"
>
<Track
v-if="item.type === 'track'"
:item="item"/>
<Artist
v-else-if="item.type === 'artist'"
:item="item"/>
<Unknown v-else :item="item"/>
</span>
:item="item"
/>
</div>
</div>
</template>
@ -60,7 +54,11 @@ export default {
error: ``,
api_base: `https://api.spotify.com/v1`,
};},
computed: {},
computed: {
items() {
return this.data.filter(item => item.type === this.config.type.slice(0, -1).toLowerCase())
}
},
methods: {
get_token() {
let params = new URLSearchParams(window.location.hash.slice(1));