簡體   English   中英

在Polymer Dart模板化器實例中編輯輸入字段會引發錯誤

[英]Editing input field in a Polymer Dart templatizer instance throws an error

我們有一個用dart編寫的聚合物元素(版本1.0.0-rc.18)。 <list-outer>元素使用Templatizer行為來迭代對象列表。

<list-outer>
    <template>               
        <iron-label>{{row.name}}</iron-label>
        <paper-input value="{{row.name}}"></paper-input>
    </template>
</list-outer>

飛鏢部分:

@PolymerRegister('list-outer')
class ListOuter extends PolymerElement with Templatizer {

  @property
  List<Object> datax = [
    {"name": "xxx", "age": 2},
    {"name": "yyy", "age": 3}
  ];

  ListOuter.created() : super.created() ;

  @override
  void ready() {   
    Element template = Polymer.dom(this).querySelector('template');

    this.templatize(template);

    datax.forEach((row) {
      TemplateInstance instance = this.stamp({});

      Polymer.dom(this).append(instance.root);

      instance.set('row', row);
    });
  }
}

如果我嘗試編輯內部<paper-input>的數據,我們總是會得到以下異常。 也許我們錯過了什么,但不知道是什么。

**Uncaught TypeError: dataHost._templatized._notifyPath is not a function**
Polymer.Templatizer._notifyPathUpImpl @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:11533Polymer.Base._addFeature._notifyPath @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:8009Polymer.Base._addFeature.set @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:8108(anonymous function) @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:7118Polymer.Base._addFeature._notifyListener @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:7885(anonymous function) @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:7151Polymer.Base._addFeature.fire @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:6627Polymer.Bind._modelApi._notifyChange @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:6904Polymer.Base.extend._notifyEffect @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:7185Polymer.Bind._modelApi._effectEffects @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:6962Polymer.Bind._modelApi._propertySetter @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:6937setter @ index.html

...

似乎是js Polymer中已知錯誤的變體。

https://github.com/Polymer/polymer/issues/3899

有關研究,請參閱評論。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM