vue页面Uncaught TypeError: Cannot read properties of undefined (reading ‘install’)报错,页面全空白。vue页面Uncaught TypeError: Cannot read properties of undefined (reading install)报错,页面全空白。 然后发现是自己写的指令全局引用的原因 使用了export导出 export { preventReClick } 所以引用的时候不能 import preventReClick from '@/directives'Vue.use(preventReClick) 正确的应该
然后发现是自己写的指令全局引用的原因

使用了export导出
export { preventReClick }
所以引用的时候不能
import preventReClick from '@/directives'
Vue.use(preventReClick)
正确的应该是:
import { preventReClick } from '@/directives'
Vue.use(preventReClick)
这里就要注意:通过export方式导出,在导入(import)时要加花括号{ },export default则不需要花括号{ }。
还有另外一种可能是:vue-router版本过高
织梦狗教程
本文标题为:Uncaught TypeError: Cannot read properties of undefined (reading ‘install‘)报错


基础教程推荐
猜你喜欢
- AJax 把拿到的后台数据在页面中渲染的实例 2023-02-22
- 解决:layUI数据表格+简单查询 2022-12-16
- JavaScript垃圾回收机制(引用计数,标记清除,性能优 2022-08-31
- 关于ajax异步访问数据的问题 2023-02-23
- Ajax提交表单并接收json实例代码 2023-02-13
- ajax实现数据分页查询 2023-01-31
- 在IE中为abbr标签加样式 2022-10-16
- 原生ajax瀑布流demo分享(必看篇) 2023-02-01
- Unicode中的常用字母小结 2022-09-21
- 纯javascript的ajax实现php异步提交表单的简单实例 2022-12-28