added paramterized car view

This commit is contained in:
SVogel 2017-07-26 11:34:41 +02:00
parent 3893e191ed
commit 018934eeed

View File

@ -0,0 +1,33 @@
<template>
<section>
<article class="car-art">
<span>{{Car.make}}</span><br>
<span>{{Car.model}}</span><br>
<span>{{Car.year}}</span>
</article>
<nuxt-link to="/">Home</nuxt-link>
</section>
</template>
<script>
import gql from 'graphql-tag'
export default {
name: "Car",
apollo: {
Car: {
query: gql`query car($id: ID) {Car(id: $id) {make model year}}`,
variables () {
return {
id: this.$route.params.id
}
}
}
},
data () {
return {
Car: {}
}
}
}
</script>