Skip to content

Instantly share code, notes, and snippets.

@praveenweb
Last active January 30, 2019 12:40
Show Gist options
  • Select an option

  • Save praveenweb/7a19a94cc1ce0235650abf20032b4e26 to your computer and use it in GitHub Desktop.

Select an option

Save praveenweb/7a19a94cc1ce0235650abf20032b4e26 to your computer and use it in GitHub Desktop.

Revisions

  1. praveenweb revised this gist Jan 30, 2019. 1 changed file with 1 addition and 17 deletions.
    18 changes: 1 addition & 17 deletions index.vue
    Original file line number Diff line number Diff line change
    @@ -24,20 +24,4 @@ export default {
    title: 'Authors of Blog'
    }
    }
    </script>

    <style>
    ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    }
    a {
    text-decoration: none;
    color: #3498DB;
    }
    a:hover {
    border-bottom: 1px solid;
    }
    </style>
    </script>
  2. praveenweb created this gist Jan 30, 2019.
    43 changes: 43 additions & 0 deletions index.vue
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    <template>
    <div>
    <h3>Authors</h3>
    <ul>
    <li v-for="item in author" :key="item.id">
    <nuxt-link :to="`/article/${item.id}`">
    {{ item.name }}
    </nuxt-link>
    </li>
    </ul>
    </div>
    </template>

    <script>
    import author from '~/apollo/queries/fetchAuthor'
    export default {
    apollo: {
    author: {
    prefetch: true,
    query: author
    }
    },
    head: {
    title: 'Authors of Blog'
    }
    }
    </script>

    <style>
    ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    }
    a {
    text-decoration: none;
    color: #3498DB;
    }
    a:hover {
    border-bottom: 1px solid;
    }
    </style>