为什么这个聚合物不以默认属性开头?

Why this polymer not starting with default attributes?

我正在开发我的第一个聚合物观看视频教程。 我想用默认属性启动聚合物,但该属性一直以未定义的形式启动...为什么会这样?

我的聚合物:

<!-- referencia do polymer -->
<link rel="import" href="bower_components/polymer/polymer.html">

<dom-module id="x-slider">

    <style>

        #imagens{
            color: blue;
        }

    </style>

    <template>
        <center>
            <div id="container">
                <div id="imagens">
                    Render imgs from src here!
                </div>
                <div id="Buttons">
                    <button name="voltar" id="botaoVoltar" on-click="botaoVoltar" ><<</button>
                    <button name="pausar" id="botaoPausar" >||</button>
                    <button name="avancar" id="botaoAvancar" >>></button>
                </div>
            </div>
        </center>
    </template>

</dom-module>

<script>
        Polymer({
            is: 'x-slider',
            properies: {
                controlVisible: {
                    type: Boolean,
                    value: false
                },
                interval: {
                    type: Number,
                    value: 0
                },
                imageFolder: {
                    type: String,
                    value: ''
                }
            },
            listeners: {
                '#botaoVoltar click': 'botaoVoltar'
            },
            botaoVoltar: function () {
                console.log('clicked');
            },
            ready: function () {
                console.log(this.controlVisible);
                this.$.botaoVoltar.hidden = !this.controlVisible;
            }
        })
</script>

我希望它从 controlVisible 开始为 false,正如您在属性中看到的那样,但是就绪函数中的 console.log 始终 returns 未定义。当我这样做时它没有收到来自 index.html 的值:

<x-slider controlVisible=true ></x-slider>

怎么了? 完整项目位于 git:https://github.com/lucasumberto/slider

您写了 properties,因为缺少 properies 字母 't'。 此外,要从元素属性传递,您必须将其编写为 control-visible 大写字母转换为 '-' + 小写字母。同样对于布尔值,您不需要编写 true。写 属性 名字使它成立。最后一件事更喜欢将 style 标签保留在 template