遇到的问题

使用在/tts路由页面中添加点击按钮去实现router /workCreate跳转

const router = useRouter();
const useAuido = (item) =>
{
  router.push({
      name: "workCreate",
      query: {
        audioUrl: item.file_path,
      }
    });
}

编译各种没有问题,但是每次run dev tts路由死活都不显示,还报错

:5173/#/tts:1 Uncaught (in promise) Maximum recursive updates exceeded in component <index>. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.

还混杂了一堆

 Slot "default" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead. 

开头以为是 template slot写法导致的查半天
后面才发现根本不是,就是少了一个import语句


解决方案:

import { useRouter } from "vue-router";  //就是少了这一句
const router = useRouter();
Logo

中国智能体开发者社区,聚焦智能体与大模型开发,提供前沿资讯、实用工具链、开源项目及行业案例。通过技术沙龙、开发者大赛等活动,促进经验交流与协作,助力开发者快速构建创新智能应用。

更多推荐