[英]x-flipox not working on custom polymer element
Hi all I am trying to create a custom Polymer Element that uses the < x-flipbox > element inside its template tag. 大家好,我正在尝试创建一个自定义的Polymer元素,该元素使用其模板标记中的<x-flipbox>元素。
However it seems that the < x-flipbox > tag it is only working on the index page and not inside my custom elements. 但是,似乎<x-flipbox>标记仅在索引页面上起作用,而不在我的自定义元素内起作用。
This is my custom element, what am I doing wrong? 这是我的自定义元素,我在做什么错?
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/x-tag-imports/x-tag-flipbox.html">
<polymer-element name="nautes-flipbox" attributes="">
<template>
<style>
:host {
display: block;
}
</style>
<x-flipbox>
<div>I'm the front face.</div>
<div>I'm the back face.</div>
</x-flipbox>
</template>
<script>
Polymer({
});
</script>
</polymer-element>
The element above is just showing the two divs. 上面的元素仅显示了两个div。
<x-flipbox>
<div>I'm the front face.</div>
<div>I'm the back face.</div>
</x-flipbox>
This one pasted in the index.html shows only one div (as it should). 粘贴在index.html中的这一行仅显示一个div(应如此)。
In addition, how can I debug this kind of issues? 此外,如何调试此类问题? (I am new to polymer and the console is not giving me any error/warning)
(我是Polymer的新手,控制台没有给我任何错误/警告)
You don't need to include it as a import, that's an old wrapper thing the Polymer folks wrote for including X-Tag elements (it's probably what's complicating this). 你不需要将它作为一个进口,这是一个老包装的东西聚合物乡亲写了包括X标记元素(它可能什么复杂化这一点)。 You can simply include the JS (as a
<script>
) and CSS (as a <link rel="stylesheet">
) inside of the x-flipbox repo's src
directory where you have your <link rel="import">
for the flipbox 你可以简单地包括JS(作为
<script>
和CSS(作为<link rel="stylesheet">
的X-flipbox回购的内部src
目录,你有你的<link rel="import">
为翻页盒
Repo: https://github.com/x-tag/flipbox/tree/master/src 回购: https://github.com/x-tag/flipbox/tree/master/src
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.