1

我在将元信息从 graphql 添加到 vue-meta 时遇到问题。

如何从外部 about.gql 信息添加到 vue-meta?我想避免再添加一个 gql 查询。所以我对 Vue 和 Apollo 不是很有经验,任何帮助都会很好!

非常感谢!

关于.vue

      <ApolloQuery :query="require('../graphql/about.gql')">
    <template slot-scope="{ result: { loading, data } }">
      <div v-if="loading">Loading...</div>
      <div class="" v-if="data">
        <div class="row">
          <div class="col-xs-12">
            <div class="p40" v-html="data.pageBy.content"></div>
          </div>
        </div>
      </div>
    </template>
  </ApolloQuery>
<script>
export default {
  data: () => ({
    loading: 0,
    error: null,
  }),
  metaInfo: {
    // title will be injected into parent titleTemplate
    title: 'About',
    meta: [
      {
        name: 'description',
        content:
          'Epiloge is about connecting in your field of interest. Our vision is to help people share their knowledge, work, projects, papers and ideas and build their network through what they do rather where they live, study or work.'
      },
      {
        property: 'og:title',
        content: 'Epiloge - Build your network in your field of interest'
      },
      { property: 'og:site_name', content: 'Epiloge' },
      { property: 'og:type', content: 'website' },
      { name: 'robots', content: 'index,follow' }
    ]
  }
}
</script>


4

0 回答 0