Vue.js v-for不支持 IE9 的解决方法
栏目: JavaScript · 发布时间: 7年前
内容简介:最近一个小项目,在最后的测试阶段出现了问题,使用了Vue,在Chrome、Firefox、Safari、IE11下都可以访问,唯独IE9下无法正常显示,排除程序问题后,最终判断是Vue的锅,替换版本后解决。经过测试,2.16、2.17 在IE9下无法使用 v-for 导致的。写了一个简单的demo,在IE9下无法显示列表,运行结果如下:
最近一个小项目,在最后的测试阶段出现了问题,使用了Vue,在Chrome、Firefox、Safari、IE11下都可以访问,唯独IE9下无法正常显示,排除程序问题后,最终判断是Vue的锅,替换版本后解决。经过测试,2.16、2.17 在IE9下无法使用 v-for 导致的。
写了一个简单的demo,在IE9下无法显示列表,运行结果如下:
测试代码如下:
<!DOCTYPE html>
<html lang=zh-CN>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>VUE</title>
</head>
<body>
<ul id="list">
<li v-for="item in items">{{ item.name }}</li>
</ul>
<script src="https://cdn.bootcss.com/vue/2.5.17/vue.min.js"></script>
<script>
var $vm = new Vue({
el: '#list',
data: {
items: [{
name: 'Hello'
}, {
name: 'World'
}]
}
});
</script>
</body>
</html>
替换到最新的版本(现在是 2.5.21,地址:https://cdn.bootcss.com/vue/2.5.21/vue.min.js),就可以正常访问了。
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- vuex对ts的支持太弱?一个让 vuex 更好的支持 typescript 的解决方案
- 浏览器支持ES6的最优解决方案
- 解决SpringBoot2.x版本对Velocity模板不支持的方案
- Go 1.11 将支持的 Go module:解决包依赖管理问题
- mybatis-plus 升级 3.0.1 支持注解通用枚举解决方案
- OpenRASP v0.31 支持 resin 服务器并解决 JDK 兼容性
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Practical Algorithms for Programmers
Andrew Binstock、John Rex / Addison-Wesley Professional / 1995-06-29 / USD 39.99
Most algorithm books today are either academic textbooks or rehashes of the same tired set of algorithms. Practical Algorithms for Programmers is the first book to give complete code implementations o......一起来看看 《Practical Algorithms for Programmers》 这本书的介绍吧!