Polymer dom repeat is not working for Select Option in IE

折月煮酒 提交于 2020-01-17 03:04:46

问题


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="https://rawgit.com/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="https://rawgit.com/webcomponents/webcomponentsjs/master/webcomponents-lite.js"></script>
    <link rel="import" href="x-example.html" />
  </head>
  <body>
    <fruits-list></fruits-list> 
  </body>
</html>

回答1:


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:

  • https://github.com/Polymer/polymer/issues/1567
  • https://github.com/Polymer/polymer/issues/1735


来源:https://stackoverflow.com/questions/36199859/polymer-dom-repeat-is-not-working-for-select-option-in-ie

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!