我正在使用聚合物入门套件,默认情况下有paper-icon-buttons
一些paper-toolbar
。
<body unresolved class="fullbleed layout vertical">
<template is="dom-bind" id="app">
<paper-drawer-panel id="paperDrawerPanel" forceNarrow>
<paper-header-panel main mode="flex">
<!-- Main Toolbar -->
<paper-toolbar id="mainToolbar">
<!-- Toolbar icons -->
<paper-icon-button icon="search"></paper-icon-button>
<paper-icon-button icon="refresh" on-tap='refreshTapped'></paper-icon-button>
</paper-toolbar>
</paper-header-panel>
</paper-drawer-panel>
</template>
<script src="scripts/app.js"></script>
如何on-tap
在刷新按钮上添加监听器?我试图添加scripts/app.js
如下所示的侦听器方法,但仍然找不到该方法。
function refreshTapped(){
document.querySelector('#myDialog').toggle();
}
当我单击按钮时,我在浏览器控制台上得到了这个:
`[dom-bind::_createEventHandler]: listener method `refreshTapped` not defined`