有无前端大佬,问一下这个警告要怎么去掉?

2021-02-07 09:54:43 +08:00
 SmallTeddy
现在测试环境每次打开项目都会出现下面三条警告,虽然不是 error,但是看着也比较烦,怎么可以去掉它们?

main.js 中加 Vue.config.productionTip = false 不可用(因为这个在测试环境下不生效,所以看看有没有其他的办法)

vue-router.esm.js?05f6:16 [vue-router] router.addRoutes() is deprecated and has been removed in Vue Router 4. Use router.addRoute() instead.

vue-router.esm.js?05f6:16 [vue-router] <router-link>'s tag prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link.

vue-router.esm.js?05f6:16 [vue-router] <router-link>'s event prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link.
2231 次点击
所在节点    问与答
2 条回复
danytdlemon1900
2021-02-07 10:45:31 +08:00
看文档,新版本的 API 有更新,警告里面有说到了
SmallTeddy
2021-02-09 16:48:15 +08:00
@danytdlemon1900 第二个和第三个问题已经解决了 第一个不知道咋改 = =

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/751960

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX