聚合物纸张输入不工作
Polymer paper-input not working
我是聚合物初学者。我安装了 Polymer v1.7,我正在尝试构建一个简单的表单。在我的应用程序中试图输入纸张,但根本没有显示。检查 DOM,注意到元素在那里,但未呈现。并且,在控制台中显示了一些与纸张相关的消息。
我决定构建一个全新的基本项目来测试该单个元素,但同样,该元素不起作用并且消息仍然存在。
我当前的代码是:
bower.json
{
"name": "test001",
"main": "index.html",
"dependencies": {
"polymer": "Polymer/polymer#^1.4.0",
"iron-elements": "PolymerElements/iron-elements#^1.0.10",
"iron-form": "PolymerElements/iron-form#^1.1.4",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"paper-elements": "PolymerElements/paper-elements#^1.0.7"
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0",
"web-component-tester": "^4.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}
}
test001-app:
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/paper-input">
<dom-module id="test001-app">
<template>
<style>
:host {
display: block;
}
</style>
<h2>Hello [[prop1]]</h2>
<paper-input label="Etiqueta"></paper-input>
</template>
<script>
Polymer({
is: 'test001-app',
properties: {
prop1: {
type: String,
value: 'test001-app',
},
},
});
</script>
</dom-module>
控制台消息:
Behavior Polymer.IronA11yKeysBehavior not found when mixing properties
into paper-input! docs.js:126
Behavior Polymer.IronFormElementBehavior not found when mixing
properties into paper-input! docs.js:126
Behavior Polymer.IronFormElementBehavior not found when mixing
properties into paper-textarea! docs.js:126
Behavior Polymer.IronA11yKeysBehavior not found when mixing properties
into Polymer.PaperInputBehavior!
我尝试在打开和关闭纸标签(即:abc)之间放置一些内容并显示出来,但不是作为输入元素(只是作为基本文本)
您对 <paper-input>
的 HTML 导入不正确:
<!-- wrong -->
<link rel="import" href="../../bower_components/paper-input">
应该是:
<link rel="import" href="../../bower_components/paper-input/paper-input.html">
我是聚合物初学者。我安装了 Polymer v1.7,我正在尝试构建一个简单的表单。在我的应用程序中试图输入纸张,但根本没有显示。检查 DOM,注意到元素在那里,但未呈现。并且,在控制台中显示了一些与纸张相关的消息。 我决定构建一个全新的基本项目来测试该单个元素,但同样,该元素不起作用并且消息仍然存在。
我当前的代码是:
bower.json
{
"name": "test001",
"main": "index.html",
"dependencies": {
"polymer": "Polymer/polymer#^1.4.0",
"iron-elements": "PolymerElements/iron-elements#^1.0.10",
"iron-form": "PolymerElements/iron-form#^1.1.4",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"paper-elements": "PolymerElements/paper-elements#^1.0.7"
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0",
"web-component-tester": "^4.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}
}
test001-app:
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/paper-input">
<dom-module id="test001-app">
<template>
<style>
:host {
display: block;
}
</style>
<h2>Hello [[prop1]]</h2>
<paper-input label="Etiqueta"></paper-input>
</template>
<script>
Polymer({
is: 'test001-app',
properties: {
prop1: {
type: String,
value: 'test001-app',
},
},
});
</script>
</dom-module>
控制台消息:
Behavior Polymer.IronA11yKeysBehavior not found when mixing properties into paper-input! docs.js:126
Behavior Polymer.IronFormElementBehavior not found when mixing properties into paper-input! docs.js:126
Behavior Polymer.IronFormElementBehavior not found when mixing properties into paper-textarea! docs.js:126
Behavior Polymer.IronA11yKeysBehavior not found when mixing properties into Polymer.PaperInputBehavior!
我尝试在打开和关闭纸标签(即:abc)之间放置一些内容并显示出来,但不是作为输入元素(只是作为基本文本)
您对 <paper-input>
的 HTML 导入不正确:
<!-- wrong -->
<link rel="import" href="../../bower_components/paper-input">
应该是:
<link rel="import" href="../../bower_components/paper-input/paper-input.html">