Created
July 26, 2020 23:44
-
-
Save djmtype/cc98ce1a62e77101d41f215db7c9e521 to your computer and use it in GitHub Desktop.
Spotify Gridsome
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<h1 v-html="$page.oneGraph.spotify.me.id" /> | |
<ul> | |
<li v-for="(item, index) in $page.oneGraph.spotify.me.playlists" :key="index"> | |
<g-link :to="item.externalUrls.spotify">{{item.name}}</g-link> | |
<img :src="item.images[0].url" :height="300" :width="300" /> | |
</li> | |
</ul> | |
</div> | |
</template> | |
<page-query> | |
{ | |
oneGraph { | |
spotify { | |
me { | |
id | |
playlists(limit: 10) { | |
id | |
name | |
images { | |
url | |
height | |
width | |
} | |
externalUrls { | |
spotify | |
} | |
tracks { | |
id | |
name | |
durationMs | |
artists { | |
id | |
name | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
</page-query> | |
<script> | |
export default { | |
metaInfo: { | |
title: 'Hello, world!' | |
} | |
} | |
</script> | |
<style> | |
li { | |
margin-bottom: 1.5rem; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment