zoukankan      html  css  js  c++  java
  • [Polymer] Introduction

    install Polymer and explore creating our first custom element:

     bower install polymer

    index.html:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Polymer</title>
        <script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
        <link rel="import" href="bower_components/polymer/polymer.html">
        <link rel="import" href="./hello-world.html">
    </head>
    <body>
    <hello-world name="ZTW"></hello-world>
    </body>
    </html>
    • include webcomponents-list.js file
    • import polymer.html file
    • import our compoment hello-world.html file

    hello-world.html:

    <dom-module id="hello-world">
        <template>
            <input type="text" value="{{name::keyup}}"> <!-- {{}} two way data binding, ::bind to event -->
            <h1>Hello, [[name]]</h1> <!-- [[]] one way data binding -->
        </template>
        <script>
            Polymer({
                is: "hello-world"  // string match the tag
            })
        </script>
    </dom-module>
  • 相关阅读:
    hdu 5902 Seam Carving
    hdu 5091 Beam Cannon
    hdu 1542 Atlantis
    hdu 2196 Computer
    第一个爬虫和测试
    排球比赛规则
    第十周博客作业
    科学计算可视化
    用matplotlib绘制图像
    面对对象学习
  • 原文地址:https://www.cnblogs.com/Answer1215/p/5065447.html
Copyright © 2011-2022 走看看