Vippspppspsps

This commit is contained in:
Kasper Rynning-Tønnesen
2020-01-22 13:13:52 +01:00
parent bd1a626a96
commit 431818c260
7 changed files with 103 additions and 18 deletions

View File

@@ -3,8 +3,14 @@
<h3>Viner</h3>
<ol>
<li v-for="wine in wines">
<span v-if="wine.vivinoLink == '' || wine.vivinoLink == null">{{ wine.name }} - sett {{ wine.occurences }} ganger, {{ wine.rating }} i rating</span>
<a :href="wine.vivinoLink" v-if="wine.vivinoLink != '' && wine.vivinoLink != null">{{ wine.name }} - sett {{ wine.occurences }} ganger, {{ wine.rating }} i rating</a></li>
<span
v-if="wine.vivinoLink == '' || wine.vivinoLink == null"
>{{ wine.name }} - sett {{ wine.occurences }} ganger, {{ wine.rating }} i rating</span>
<a
:href="wine.vivinoLink"
v-if="wine.vivinoLink != '' && wine.vivinoLink != null"
>{{ wine.name }} - sett {{ wine.occurences }} ganger, {{ wine.rating }} i rating</a>
</li>
</ol>
</div>
</template>
@@ -19,11 +25,9 @@ export default {
let response = await _response.json();
response.sort();
response = response.filter(
wine => wine.name != null && wine.name != ""
).sort((a, b) =>
a.occurences > b.occurences ? -1 : 1
);
response = response
.filter(wine => wine.name != null && wine.name != "")
.sort((a, b) => (a.occurences > b.occurences ? -1 : 1));
this.wines = response;
}
};
@@ -31,16 +35,17 @@ export default {
<style lang="scss" scoped>
h3 {
text-align:center;
text-align: center;
}
div {
margin: auto 0;
font-family: "knowit";
display: inline-flex;
flex-direction: column;
}
a {
text-decoration: none;
color: orange;
text-decoration: none;
color: orange;
}
</style>