Properties 无法设置属性'_父数据URL';聚合物中未定义的分子量
我正在尝试设置自定义标记的属性。但它给出了错误。我附上错误截图和代码片段也Properties 无法设置属性'_父数据URL';聚合物中未定义的分子量,properties,polymer-1.0,Properties,Polymer 1.0,我正在尝试设置自定义标记的属性。但它给出了错误。我附上错误截图和代码片段也 <awts-est data-url$="{{dataUrl}}"></awts-est> properties: { dataUrl: { type: String, value: '', reflectToAttribute: true, }, } 特性:{ 数据UR
<awts-est data-url$="{{dataUrl}}"></awts-est>
properties: {
dataUrl: {
type: String,
value: '',
reflectToAttribute: true,
},
}
特性:{
数据URL:{
类型:字符串,
值:“”,
reflectToAttribute:true,
},
}
在demo/index.html中
<awtt-ch data-url="http://abc.asdfg.com"></awtt-ch>
<html>
<head>
<script src="bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
<link href="elements/awtt-ch.html" rel="import">
</head>
<body>
<awtt-ch data-url="http://abc.asdfg.com"></awtt-ch>
</body>
</html>
好的,我返回并重新创建了您的构建。我相信这就是你们在基础水平上所拥有的。这已成功从dataUrl打印数据 index.html
<awtt-ch data-url="http://abc.asdfg.com"></awtt-ch>
<html>
<head>
<script src="bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
<link href="elements/awtt-ch.html" rel="import">
</head>
<body>
<awtt-ch data-url="http://abc.asdfg.com"></awtt-ch>
</body>
</html>
元素/awtt-ch.html
<head>
<link href="../bower_components/polymer/polymer.html" rel="import">
<link href="/elements/awts-est.html" rel="import">
</head>
<dom-module id="awtt-ch">
<template>
<awts-est data-url$="{{dataUrl}}"></awts-est>
</template>
</dom-module>
<script>
Polymer({
is: "awtt-ch",
properties: {
dataUrl: {
type: String,
notify: true,
}
}
});
</script>
聚合物({
是:“awtt-ch”,
特性:{
数据URL:{
类型:字符串,
通知:正确,
}
}
});
elements/awts-est.html
<html>
<head>
<link href="../bower_components/polymer/polymer.html" rel="import">
<link href="/elements/awts-est.html" rel="import">
</head>
<dom-module id="awts-est">
<template>
<h1>Here's your data: <span>{{dataUrl}}</span></h1>
</template>
</dom-module>
<script>
Polymer({
is: "awts-est",
properties: {
dataUrl: {
type: String,
notify: true,
}
}
});
</script>
这是您的数据:{{dataUrl}
聚合物({
是:“awts est”,
特性:{
数据URL:{
类型:字符串,
通知:正确,
}
}
});
好的,我返回并重新创建了您的构建。我相信这就是你们在基础水平上所拥有的。这已成功从dataUrl打印数据
index.html
<awtt-ch data-url="http://abc.asdfg.com"></awtt-ch>
<html>
<head>
<script src="bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
<link href="elements/awtt-ch.html" rel="import">
</head>
<body>
<awtt-ch data-url="http://abc.asdfg.com"></awtt-ch>
</body>
</html>
元素/awtt-ch.html
<head>
<link href="../bower_components/polymer/polymer.html" rel="import">
<link href="/elements/awts-est.html" rel="import">
</head>
<dom-module id="awtt-ch">
<template>
<awts-est data-url$="{{dataUrl}}"></awts-est>
</template>
</dom-module>
<script>
Polymer({
is: "awtt-ch",
properties: {
dataUrl: {
type: String,
notify: true,
}
}
});
</script>
聚合物({
是:“awtt-ch”,
特性:{
数据URL:{
类型:字符串,
通知:正确,
}
}
});
elements/awts-est.html
<html>
<head>
<link href="../bower_components/polymer/polymer.html" rel="import">
<link href="/elements/awts-est.html" rel="import">
</head>
<dom-module id="awts-est">
<template>
<h1>Here's your data: <span>{{dataUrl}}</span></h1>
</template>
</dom-module>
<script>
Polymer({
is: "awts-est",
properties: {
dataUrl: {
type: String,
notify: true,
}
}
});
</script>
这是您的数据:{{dataUrl}
聚合物({
是:“awts est”,
特性:{
数据URL:{
类型:字符串,
通知:正确,
}
}
});
明天我到办公室给你写一个小脚本时,我会看一看。另外,我只是想澄清一下,它们应该是不同的元素,对吗?Anky我回去更新了我的答案。这应该行得通,是我这边的事。在没有看到所有代码的情况下,我不确定发生了什么,但这是一个供您使用的工作模板。如果你还需要什么,请告诉我!我真的很感谢你。我正在尝试这个代码。明天我到办公室给你写一个小脚本时,我会看一看。另外,我只是想澄清一下,它们应该是不同的元素,对吗?Anky我回去更新了我的答案。这应该行得通,是我这边的事。在没有看到所有代码的情况下,我不确定发生了什么,但这是一个供您使用的工作模板。如果你还需要什么,请告诉我!我真的很感谢你。我正在尝试使用此代码。