Gridsome - “类别未在实例上定义但在渲染期间引用”

问题描述

我正在使用 Gridsome 博客启动器,并且我正在尝试在帖子上方添加一个类别列表:

下面是查询。虽然它在 /__explore 上按预期工作, 在应用程序本身上,我得到了 error: vue.runtime.esm.js?2b0e:619 [Vue warn]: Property or method "category" is not defined on the instance but referenced during render. Make sure that this property is reactive,either in the data option or for class-based components,by initializing the property.

<page-query>
{
  Metadata {
    sanityOptions {
      projectId
      dataset
    }
  }
  posts: allSanityPost(sortBy: "publishedAt") {
    edges {
      node {
        id
        title
        slug {
          current
        }
        categories {
          id
          title
        }
        publishedAt(format: "D. MMMM YYYY")
        _rawExcerpt
        mainImage {
          asset {
            _id
            url
          }
          caption
          alt
          hotspot {
            x
            y
            height
            width
          }
          crop {
            top
            bottom
            left
            right
          }
        }
      }
    }
  }
  categories: allSanityCategory(sortBy: "publishedAt") {
    edges {
      node {
        id
        title
      }
    }
  }

有了那个错误,它仍然显示两个类别,正如预期的那样,当我只用“a”填充它而不是 {{category.title}}

感谢您的帮助。 视频。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...