问题描述
我正在使用 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 (将#修改为@)