gpt4 book ai didi

html - polymer 纸张输入变化不会在 firefox 33.0.3 上触发

转载 作者:行者123 更新时间:2023-11-28 01:39:10 25 4
gpt4 key购买 nike

我正在尝试运行 http://itshackademic.com/static/codelabs/3-polymer-build-mobile/ 中给出的教程示例.最终代码在 Chrome 上运行良好。但是,在 firefox 33.0.3 上 <paper-input on-change="{{add}}"/>没有调用适当的函数。代码如下,正如我提到的,在纸张输入时按“返回”不会触发该功能。我检查了几个类似的问题(thisthis),但那里的解决方案并不适用。

该代码在 Chrome 上运行良好。有什么建议吗?

index.html:

<!doctype html>

<html>
<head>
<title>PolymerMobileCodelab</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">

<script src="bower_components/webcomponentsjs/webcomponents.js"></script>

<link rel="import" href="codelab-app.html">
</head>

<body unresolved>
<codelab-app></codelab-app>
</body>
</html>

codelab-app.html:

<!-- New polymer element -->

<link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="bower_components/font-roboto/roboto.html">

<link rel="import" href="bower_components/core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="bower_components/core-header-panel/core-header-panel.html">
<link rel="import" href="bower_components/core-toolbar/core-toolbar.html">
<link rel="import" href="bower_components/core-icons/core-icons.html">

<link rel="import" href="bower_components/core-localstorage/core-localstorage.html">

<link rel="import" href="bower_components/paper-icon-button/paper-icon-button.html">
<link rel="import" href="bower_components/paper-fab/paper-fab.html">
<link rel="import" href="bower_components/paper-input/paper-input.html">
<link rel="import" href="bower_components/paper-checkbox/paper-checkbox.html">

<polymer-element name="codelab-app">
<template>
<link rel="stylesheet" href="styles.css">
<core-drawer-panel id="drawerPanel" responsiveWidth="641px">

<core-header-panel drawer>
<core-toolbar>Menu</core-toolbar>
</core-header-panel>

<core-header-panel main>
<core-toolbar>
<paper-icon-button icon="menu" core-drawer-toggle>

</paper-icon-button>
<span flex>My notes</span>
<paper-icon-button icon="search"></paper-icon-button>
<paper-icon-button icon="more-vert"></paper-icon-button>

<paper-fab icon="icons:add" on-click="{{showNewNoteInput}}"></paper-fab>
</core-toolbar>

<div class="content">
<paper-input id="newNoteInput"
floatingLabel
on-change="{{add}}"
value="{{newNote}}"
label="Add a new note"></paper-input>
<template repeat="{{data}}" >
<div center horizontal layout class="item">
<paper-checkbox checked="{{done}}" on-change="{{dataChanged}}"></paper-checkbox>
<div flex class="card">
<p>{{body}}</p>
</div>
<!-- paper-icon-button icon="clear" on-click="{{remove}}"></paper-icon-button -->
</div>
</template>
</div>

</core-header-panel>

</core-drawer-panel>
<core-localstorage id="storage" name="codelab-app-storage" value="{{data}}"></core-localstorage>
</template>
<script>
Polymer({
data: [],
ready: function() {
this.$.newNoteInput.style.display = 'none';
},
showNewNoteInput: function() {
this.$.newNoteInput.style.display = 'block';
},

add: function() {
if (this.newNote) {
this.data.unshift({
body: this.newNote,
done: false
});
this.$.newNoteInput.style.display = 'none';
this.$.newNoteInput.value = null;
}
},
remove: function() {

},
dataChanged: function() {
this.$.storage.save();
}
});
</script>
</polymer-element>

最佳答案

这是 Polymer 方面的问题。已于 current version 解决.

change() 操作在 paper-input.html 中声明,并且有条件执行并防止在旧浏览器上触发。

关于html - polymer 纸张输入变化不会在 firefox 33.0.3 上触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27028713/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com