聚合物dom重复不适用于IE中的“选择选项"

编程入门 行业动态 更新时间:2024-10-27 02:18:39
本文介绍了聚合物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中的“选择选项"

本文发布于:2023-08-02 15:33:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1278927.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:聚合物   选项   不适用于   quot   dom

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!