解决IE报错[vue router]Failed to resolve async component default:strict 模式下不允许分配到只读属性
之前遇到过一个奇怪的问题,在其他浏览器下一切正常,但在万恶的IE下,却一直不行。
具体问题场景就是:比如orderDetail页面出现问题,那么只要是路由跳转的,点第1次无法跳转,必须得点第2次才可以跳转,但是跳转过去之后,页面也是一片空白,不加载路由页面。然后控制台报错:strict 模式下不允许分配到只读属性。
所以我往这方面搜索,在网上看到一些相关信息
IE中JavaScript异常提示:strict 模式下不允许分配到只读属性。报异常的代码如下:
document.getElementById("mapLayer").style = "width: 98%;height:98%;";
解决方法如下: 将css属性拆分开依次设置属性值即可。
document.getElementById("mapLayer").style.width = "98%";
document.getElementById("mapLayer").style.height = "98%";
注:在这严格模式下xxx.style会被认定为只读属性,所以在IE中报错。
但是,我在我的代码里找了几圈都没有找到类似的只读属性。
没办法,只能使用傻办法一层一层排查。最后发现把orderDetail页面里的内容全部换成其他页面,发现是可以正常的,由此可以确定,问题就出在该orderDetail页面里,然后再到orderDetail页面里一层一层排查。发现问题出在这里
import QRCode from 'qrcode' // 动态生成二维码
useqrcode () {
let canvas = document.getElementById('canvas')
let _this = this
QRCode.toCanvas(canvas, this.qrcode, function (error) {
if (error) {
_this.$message({
message: '二维码生成失败,请重新支付',
type: 'error'
})
}
})
},
关键是不知道为什么引入QRCode,然后画图会导致IE报这种错,对IE实在是蛋疼,没办法只能修改这地方
解决方案:换 qriously 生成二维码
<qriously class="qrcode" :value="qrcode" :size=""/>
修改之后一切正常了。
解决IE报错[vue router]Failed to resolve async component default:strict 模式下不允许分配到只读属性的更多相关文章
- Vue-cli3.x在开发环境中(router采用 history模式)出现Failed to resolve async component default: Error: Loading chunk {/d} failed.或者Uncaught SyntaxError: Unexpected token <错误
使用Vue-cli3.x开发环境中(router采用 history模式)出现Failed to resolve async component default: Error: Loading chu ...
- [vue-router] Failed to resolve async component default: Error: Loading chunk 0 failed.
在整合laravel5.4 和vue2.1的时候遇到一个奇怪的问题 Uncaught SyntaxError: Unexpected token < Error: Loading chunk 0 ...
- jeakins配置邮件通知,附带解决535报错:authentication failed,如果发现测试邮件可以发出,项目构成无法发出邮件,请开启SSL认证,端口号改为(465),qq邮箱、163邮箱通用
535报错解决方案:调用163邮箱服务器来发送邮件,我们需要开启POP3/SMTP服务,这时163邮件会让我们设置客户端授权码,这个授权码替代上面代码部分的passwd即可成功发送邮件 如果设置的邮箱 ...
- 解决 Qt5 报错 This application failed to start because it could not find or load the Qt platform plugin
QT为了简化生成发布版本,特别提供了工具 "windeplayqt.exe",这个工具在 "...\Qt5.8.0\5.8\msvc2015_64\bin"的目 ...
- SVN 执行cleanup报错:Cleanup failed to process the following paths
SVN 执行cleanup报错:Cleanup failed to process the following paths 先来说下这个错误的原因:用SVN在使用过程中,各种原因中途取消或中断,导致需 ...
- centos6.5报错:checking filesystems failed问题处理
centos系统重启报错:checking filesystems failed checking filesystems /dev/mapper/vg_0-root: 搜了下可能是文件系统损坏 根据 ...
- vue解决启动报错cjs loader.js Error: Cannot find module '../config'问题
vue解决启动报错cjs loader.js Error: Cannot find module '../config'问题 今天下载了一个开源项目一直运行不了,折腾了半天才找到问题所在,config ...
- Vue报错 type check failed for prop “xxx“. Expected String with value “xx“,got Number with value ‘xx‘
vue报错 [Vue warn]: Invalid prop: type check failed for prop "name". Expected String with ...
- centos 关闭selinux 临时关闭selinux 报错 setenforce: setenforce() failed
关闭selinux的方法有两种:临时关闭和永久关闭. 查看selinux的状态:estatus [root@--- ~]# sestatus SELinux status: enabled SELin ...
随机推荐
- Java 中文转换拼音工具
Java 中文转换拼音工具 /** * <html> * <body> * <P> Copyright 1994 JsonInternational</p&g ...
- css3 media媒体查询器用法总结(附js兼容方法)
css3 media媒体查询器用法总结 标签:class 代码 style html sp src 随着响应式设计模型的诞生,Web网站又要发生翻天腹地的改革浪潮,可能有些人会觉得 ...
- Flink入门 - CoGroup和Join
/* *CoGroup */ final StreamExecutionEnvironment streamExecutionEnvironment = StreamExecutionEnvironm ...
- Windows Server 2008 R2 + IIS 环境部署Asp.Net Core App
Windows + IIS 环境部署Asp.Net Core App 环境:Windows Server 2012, IIS 8, Asp.Net Core 1.1. 不少人第一次在IIS中部署A ...
- scrapy xpath去除空格
content = response.xpath("normalize-space('//img/@src')")
- 基于JFinal中搭建wopi协议支撑办法
1.添加maven依赖 <dependency> <groupId>com.github.icecooly</groupId> <artifactId> ...
- [AI] 切换cuda版本的万金油
1. 环境 ubuntu16.04 GTX1080Ti x 4 nvidia-418 cuda-10.1 pytorch1.0.0 目标:在最新的显卡驱动下,使用不同版本的cuda和深度学习框架来执行 ...
- 2019安徽省程序设计竞赛 I.你的名字(序列自动机)
这题和今年南昌邀请网络预选赛M题很像啊,不过主串数量不是一个了 都是在主串中判断子串是不是属于主串的一个子序列 #include <iostream> #include <cstri ...
- Spring Boot-初学01 -使用Spring Initializer快速创建Spring Boot项目 -@RestController+spEL -实现简单SpringBoot的Web页面
1.IDEA:使用 Spring Initializer快速创建项目 IDE都支持使用Spring的项目创建向导快速创建一个Spring Boot项目: 选择我们需要的模块:向导会联网创建Spring ...
- 手写二叉树-先序构造(泛型)-层序遍历(Java版)
如题 先序构造 数据类型使用了泛型,在后续的更改中,更换数据类型只需要少许的变更代码 层序遍历 利用Node类的level属性 所有属性的权限全为public ,为了方便先这么写吧,建议还是用priv ...