解决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 ...
随机推荐
- kubernetes-dashboard登录出现forbidden 403
登录k8s dashboard https://xxxxx:6443/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard ...
- redis监控工具汇总
redis-stat redis-stat是一个比较有名的redis指标可视化的监控工具,采用ruby开发,基于redis的info命令来统计,不影响redis性能. docker运行 docker ...
- C# 多线程与高并发处理并且具备暂停、继续、停止功能
--近期有一个需要运用多线程的项目,会有并发概率,所以写了一份代码,可能有写地方还不完善,后续有需求在改 1 /// <summary> /// 并发对象 /// </summary ...
- C# vb .net实现位图蒙版特效滤镜
在.net中,如何简单快捷地实现Photoshop滤镜组中的位图蒙版特效呢?答案是调用SharpImage!专业图像特效滤镜和合成类库.下面开始演示关键代码,您也可以在文末下载全部源码: 设置授权 第 ...
- InheritedWidget and screen
self: import 'package:flutter/material.dart'; class GrantScreen { static double _width, _height; sta ...
- 【面试突击】-SpringBoot面试题(一)
Spring Boot 是微服务中最好的 Java 框架. 我们建议你能够成为一名 Spring Boot 的专家. 问题一 Spring Boot.Spring MVC 和 Spring 有什么区别 ...
- 创建Spring boot project报错:Project build error: Non-resolvable parent POM for xxx:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent
刚开始创建Spring boot项目时,pom.xml文件时报如下图错误: 在网上百度的说让更新下Maven的update project,我试了没用,最后将version版本改了就行了,我原来版本是 ...
- Android Scroller详解
在学习使用Scroller之前,需要明白scrollTo().scrollBy()方法. 一.View的scrollTo().scrollBy() scrollTo.scrollBy方法是View中的 ...
- (摘录笔记)JAVA学习笔记SSH整合搭建项目
1:当然是导jar包啦: struts2: spring: hibernate: 至于这些jar包是什么作用,我想就不必我解释了,大家都懂得,ssh2基本的jar包: 还有一些其他jar包:strut ...
- mysqlbinlog 恢复数据到任意时间点
创建表,插入数据. ``` mysql> create database binlog; mysql> create table bt(id int); mysql> insert ...