とにかく、Polymerでプログラムで鉄のページを切り替える方法はありますか?私のポイントは、Polymerでアクションが実行されたときにページをリダイレクトしたいということです。
私は知っています、私はを使用してリダイレクトできwindow.location.href
ますが、プログラムでポリマーの鉄ページを切り替えることを知る必要があります。
_responseChanged: function(response) {
console.log('response', response.applicationId);
/*
I want to redirect page here
*/
},
以下はあなたがそれをすることができる3つの方法です
selectNext
常に次のページを選択する関数を呼び出すselect
関数を呼び出して、選択したいページ番号を渡しますselected
アイアンページのプロパティを直接変更することもできます(以下では説明しません)<base href="https://polygit.org/components/">
<link rel="import" href="polymer/polymer.html">
<link rel="import" href="iron-pages/iron-pages.html">
<dom-module id="iron-page-select">
<template>
<style></style>
<iron-pages id="pages" selected="0">
<div on-tap="_selectNext">tap me to change to next page</div>
<div on-tap="_selectCustom">tap me to change to 4th page</div>
<div>three</div>
<div>four</div>
</iron-pages>
</template>
</dom-module>
<script>
Polymer({
is: 'iron-page-select',
_selectNext: function() {
this.$.pages.selectNext();
},
_selectCustom: function() {
this.$.pages.select(3);
}
})
</script>
<iron-page-select></iron-page-select>
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加