Adjust how the items are being given to Vue
This commit is contained in:
parent
601b684195
commit
f5d3b6cb82
1 changed files with 10 additions and 12 deletions
|
|
@ -12,18 +12,12 @@
|
||||||
/>
|
/>
|
||||||
<div v-if="error" class="error">{{ error }}</div>
|
<div v-if="error" class="error">{{ error }}</div>
|
||||||
<div v-else id="data_view">
|
<div v-else id="data_view">
|
||||||
<span
|
<component
|
||||||
v-for="item in data"
|
:is="config.type.slice(0, -1)"
|
||||||
|
v-for="item in items"
|
||||||
:key="item.uri"
|
:key="item.uri"
|
||||||
>
|
:item="item"
|
||||||
<Track
|
/>
|
||||||
v-if="item.type === 'track'"
|
|
||||||
:item="item"/>
|
|
||||||
<Artist
|
|
||||||
v-else-if="item.type === 'artist'"
|
|
||||||
:item="item"/>
|
|
||||||
<Unknown v-else :item="item"/>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -60,7 +54,11 @@ export default {
|
||||||
error: ``,
|
error: ``,
|
||||||
api_base: `https://api.spotify.com/v1`,
|
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: {
|
methods: {
|
||||||
get_token() {
|
get_token() {
|
||||||
let params = new URLSearchParams(window.location.hash.slice(1));
|
let params = new URLSearchParams(window.location.hash.slice(1));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue