我曾尝试设置一个非常简单的nuxt内容示例,但即便如此,在打开localhost:port/时也会遇到Maximum call stack size exceeded错误。
pages/_slag.vue:
<template>
<nuxt-content :document="doc" />
</template>
<script>
export default {
async asyncData({ $content, params }) {
const doc = await $content(params.slug || 'index');
return { doc }
}
};
</script>content/index.md:
# Hello @nuxtjs/content!
Super fast HMR!nuxt-config.js:
export default {
vue: {
config: {
// https://vue-loader.vuejs.org/options.html#cachedirectory-cacheidentifier
},
},
target: 'static',
buildModules: [
],
modules: [
'@nuxt/content'
],
content: {
},
build: {
},
generate: {
concurrency: 2000,
}
}package.json:
"dependencies": {
"@nuxtjs/axios": "^5.13.6",
"@nuxtjs/tailwindcss": "^4.2.1",
"@nuxt/content": "1.14.0",
"core-js": "^3.18.0",
"nuxt": "^2.15.8",
"vue-inline-svg": "^2.0.0"
},
"devDependencies": {
"@vue/test-utils": "^1.2.1",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^27.0.5",
"jest": "^27.0.5",
"postcss": "^8.3.5",
"vue-jest": "^3.0.4"
},
"optionalDependencies": {
"fsevents": "^2.3.2"
}我做错了什么?
发布于 2021-10-02 07:19:34
您没有获取所查询的数据。按如下方式更新您的$content:$content(params.slug || 'index').fetch()
https://stackoverflow.com/questions/69414752
复制相似问题