upash / peco

nothing here, move on..
MIT License
209 stars 12 forks source link

Query data with GraphQL #22

Open egoist opened 6 years ago

egoist commented 6 years ago

https://github.com/egoist/graphql-aot

Example ./theme/layouts/index.vue:

<template>
  <div>
    <div v-for="page in pages">{{ page.title }}</div>
  </div>
</template>

<script>
const { data: { pages } } = graphql`
  pages {
    title
    body
  }
`

export default {
  data() {
    return { pages }
  }
}
</script>