本文介绍了聚合物dom重复不适用于IE中的“选择选项"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用波纹管代码创建一个聚合物下拉列表元素,它在除IE之外的所有浏览器中都能正常工作.
fruits-list.html
<link href="rawgit/polymer/polymer/0.8-preview/polymer.html" rel="import"> <dom-module id="fruits-list"> <template> <select> <template is="dom-repeat" items="{{employees}}"> <option value="{{item.value}}">{{item.text}}</option> </template> </select> </template> <script> Polymer({ is: 'fruits-list', ready: function() { this.employees = [ {value: 'one', text: 'apple'}, {value: 'two', text: 'banana'}, {value: 'three', text: 'orange'} ]; } }); </script> </dom-module>index.html
<html> <head> <script src="rawgit/webcomponents/webcomponentsjs/master/webcomponents-lite.js"></script> <link rel="import" href="x-example.html" /> </head> <body> <fruits-list></fruits-list> </body> </html>解决方案
dom-repeat不适用于IE中的所有元素(例如,不支持select和table)(最近的Edge版本支持) ).
另请参阅:
- github/Polymer/polymer/issues/1567
- github/Polymer/polymer/issues/1735
Hi i am using bellow code to create a polymer dropdown element.It is working fine in all browsers except IE.
fruits-list.html
<link href="rawgit/polymer/polymer/0.8-preview/polymer.html" rel="import"> <dom-module id="fruits-list"> <template> <select> <template is="dom-repeat" items="{{employees}}"> <option value="{{item.value}}">{{item.text}}</option> </template> </select> </template> <script> Polymer({ is: 'fruits-list', ready: function() { this.employees = [ {value: 'one', text: 'apple'}, {value: 'two', text: 'banana'}, {value: 'three', text: 'orange'} ]; } }); </script> </dom-module>index.html
<html> <head> <script src="rawgit/webcomponents/webcomponentsjs/master/webcomponents-lite.js"></script> <link rel="import" href="x-example.html" /> </head> <body> <fruits-list></fruits-list> </body> </html>解决方案
dom-repeat is not supported for all elements (e.g. select and table are not) in IE (thought it is supported in recent versions of Edge).
See also:
- github/Polymer/polymer/issues/1567
- github/Polymer/polymer/issues/1735
更多推荐
聚合物dom重复不适用于IE中的“选择选项"
发布评论