【问题标题】:nuxt router-module render function or template not defined in component: anonymous组件中未定义 nuxt 路由器模块渲染函数或模板:匿名
【发布时间】:2021-01-09 16:51:54
【问题描述】:

当我从 nuxt.config.js 文件中的构建模块中删除“@nuxtjs/router”时,错误将解决。

复制链接 https://github.com/mahdikmg/nuxt-router-module-bug

只需安装依赖项,运行项目并在浏览器中打开它。

有什么想法吗?

【问题讨论】:

    标签: vue.js nuxt.js vue-router server-side-rendering


    【解决方案1】:

    我没有检查它,但我的猜测是您指向的自定义路由位于 /pages 文件夹中。 如文档中所述,该模块完全禁用自动路由的文件夹。您是否尝试将页面移动到另一个文件夹? (比如说/routes

    【讨论】:

    • 是的,我知道这一点。我根本没有使用页面文件夹。但改变了我的计划。我现在使用 nuxt 路由器。谢谢你的评论
    猜你喜欢
    • 2019-06-17
    • 2021-01-23
    • 1970-01-01
    • 2020-07-28
    • 2019-12-08
    • 2017-02-13
    • 2018-07-05
    • 2018-05-08
    • 2020-04-26
    相关资源
    最近更新 更多