首页 > 其他分享 >vue进行跳转之后出现Cannot read properties of undefined (reading 'router') TypeError: Cannot read p

vue进行跳转之后出现Cannot read properties of undefined (reading 'router') TypeError: Cannot read p

时间:2023-10-18 17:12:02浏览次数:45  
标签:undefined read Cannot 跳转 router reading properties

问题描述

使用router进行页面跳转时,就出现了这样的问题:

也就是这里出现了问题:

问题解决

本来是按照网上的教程:

const _this=this;

但是,但是,我本来就是用的这种方法呀~

然后就打算直接在这个界面引用:

import router from '@/router'

router.push('/one');

里面引用的跳转页面链接必须为我们在index.js页面里面定义的呦~

改成这样子,就ok啦~

终于解决啦(添加成功!):

标签:undefined,read,Cannot,跳转,router,reading,properties
From: https://www.cnblogs.com/liuzijin/p/17772797.html

相关文章

  • Redission并发锁报错:IllegalMonitorStateException: attempt to unlock lock, not loc
    生产上突然出现一条报错j.l.IllegalMonitorStateException:attempttounlocklock,notlockedbycurrentthreadbynodeid:1411e030-3c44-48d7-9eb6-6030022ce681thread-id:111ato.r.RedissonBaseLock.lambda$unlockAsync$2(RedissonBaseLock.java:323)......
  • WIndows 10 更新后,登录后黑屏【AppReadiness 问题】
    现象:更新Windows10版本 的累积更新KB4038788似乎会导致用户系统上登录时出现黑屏(用户可能需要长达5~10分钟才能登录)  临时解决方法:禁用APPReadiness服务 参考资料:https://support.microsoft.com/en-us/topic/black-screen-when-windows-10-restarts-after-a-......
  • [911] Read Data from Google Sheets into Pandas without the Google Sheets API (.g
    ref:ReadDatafromGoogleSheetsintoPandaswithouttheGoogleSheetsAPIimportpandasaspdsheet_id="1XqOtPkiE_Q0dfGSoyxrH730RkwrTczcRbDeJJpqRByQ"sheet_name="Sheet1"url=f"https://docs.google.com/spreadsheets/d/{sheet......
  • 解决OSError: cannot open resource self.font = core.getfont(font, size, index, en
    解决OSError:cannotopenresourceself.font=core.getfont(font,size,index,encoding,layout_engin在使用Python编程时,我们有时会遇到OSError:cannotopenresourceself.font=core.getfont(font,size,index,encoding,layout_engin这个错误。这个错误通常是由于缺少......
  • 解决TypeError: read_excel() got an unexpected keyword argument ‘parse_cols or
    解决TypeError:read_excel()gotanunexpectedkeywordargument‘parse_cols'或‘sheetname‘在使用pandas包进行Excel文件处理时,有时候会遇到TypeError:read_excel()gotanunexpectedkeywordargument‘parse_cols'或TypeError:read_excel()gotanunexpectedkeyword......
  • Thread.Sleep() 和 Thread.SpinWait()
    Thread.Sleep()和Thread.SpinWait() 前言:应用程序应该让线程等待而不是切换。 一:Thread.Sleep(1000);Thread.Sleep()方法:是强制放弃CPU的时间片,然后重新和其他线程一起参与CPU的竞争。 二:Thread.SpinWait(1000);Thread.SpinWait()方法:只是让CPU去执行一段没有用的代......
  • threads隐私问题
    threadsapp隐私问题虽然转移数据很方便,但是处理不当的话,后有一些隐私问题;忘了是从哪个帖子里面看到的了;欢迎关注公-众-号【TaonyDaily】、留言、评论,一起学习。Don’treinventthewheel,librarycodeistheretohelp.文章来源:刘俊涛的博客若有帮助到您,欢迎点......
  • 【Java 并发编程】ThreadLocal
    目录ThreadLocalThreadLocal实现线程隔离的原理ThreadLocal内存泄漏场景ThreadLocalThreadLocal是一个将在多线程中为每一个线程创建单独的变量副本的类;当使用ThreadLocal来维护变量时,ThreadLocal会为每个线程创建单独的变量副本,避免因多线程操作共享变量而导致的数据不......
  • 解决OSError: cannot open resource self.font = core.getfont(font, size, index, en
    解决OSError:cannotopenresourceself.font=core.getfont(font,size,index,encoding,layout_engin在使用Python编程时,我们有时会遇到OSError:cannotopenresourceself.font=core.getfont(font,size,index,encoding,layout_engin这个错误。这个错误通常是由于缺少......
  • How to fix the bug that the beforeunload event cannot be triggered All In One
    HowtofixthebugthatthebeforeunloadeventcannotbetriggeredAllInOne如何修复beforeunload事件无法触发的bugAllInOnebeforeunloadconstbeforeUnloadHandler=(event)=>{event.preventDefault();//Equivalenttothefollowingle......