2017-12-01 7 views
2

iron-pageでページを変更すると、新しいページの値を設定したい。プロパティは正しい値を持ちますが、htmlは正しく更新されません。Polymer 2. Iron-Ajaxレスポンス後の他のhtml-page(iron-page)の値を変更する

ここは私のページです。このページに切り替えると、orderconfirmationの値は正しい値になります。 <td>の値はまだ空の文字列です。

handleResponse: function (data) { 
    console.log(data.detail.response); 
    var response = data.detail.response.Item; 

    this.orderconfirmation.orderreference = response.order.orderReference; 
    this.orderconfirmation.pickuptime = response.order.operationDate; 
    this.selectedpage = "booking-confirmation"; 
    }, 

は、だから私はときに私HTMLでorderconfirmation値を変更したい:私は正しい値を設定した後、私は他のページへの切り替えを行う

<dom-module id="pn-bookpickup-confirmation"> 
<template> 
<style include="main-styles"> 
</style> 
<div class="confirmation-wrapper"> 
    <h3 class="center-header">{{localize("thankYou")}}</h3> 
    <table> 
    <tr> 
     <td>{{localize("orderReference")}}:</td> 
     <td class="font-weight-bold" id="orederRefId">{{orderconfirmation.orderreference}}</td> 
    </tr> 
    </table> 
</div> 
</template> 
<script> 
Polymer({ 
    is: "pn-bookpickup-confirmation", 
    behaviors: [ 
    PnLocalizeBehavior 
    ], 
    properties: { 
    language: { 
     type: String, 
     notify: true 
    }, 
    orderconfirmation: { 
     type: Object, 
     notify: true, 
     value: function() { 
     return { 
      pickuptime: "", 
      orderreference: "" 
     } 
     } 
    }, 
    }, 
    }); 
    </script> 
</dom-module> 

そして、ここに私のメインページでデータを再調査した。 これをどのように処理すべきか知っている人は誰ですか? this.setthis.set('orderconfirmation.orderreference', response.order.orderReference); this.set('orderconfirmation.pickuptime ', response.order.operationDate);

はサブプロパティに観察可能な変更を行うには、setメソッドを使用します。 はあなたが私がしようとすることをお勧めします提供

答えて

関連する問題