美文网首页
vue:路由跳转 $router 报 null

vue:路由跳转 $router 报 null

作者: 岚平果 | 来源:发表于2021-07-29 15:21 被阅读0次
一、问题出现
image.png image.png
如上,路由跳转报错,糟心的问题出现原因是因为把方法写在了 methods 平级里,对自己真无语。data 中 return 无值,最容易出现这种低级错误了
二、问题解决

把 事件方法 写在 methods 中, 对自己真无语呀


image.png

相关文章

网友评论

      本文标题:vue:路由跳转 $router 报 null

      本文链接:https://www.haomeiwen.com/subject/wszxvltx.html