polymer 你好,世界
示例
本示例创建一个名为的Polymer元素x-foo,其元素绑定到名为“message”的字符串属性。元素的HTML导入到主文档中,从而允许使用中的<x-foo>标记<body>。
x-foo.html
<dom-module id="x-foo">
<template>
<span>{{message}}</span>
</template>
<script>
Polymer({
is: 'x-foo',
properties : {
message: {
type: String,
value: "你好,世界!"
}
}
});
</script>
</dom-module>index.html
<head>
<!-- PolyGit used here as CDN for demo purposes only. In production,
it's recommended to import Polymer and Web Components locally
from Bower. -->
<base href="https://polygit.org/polymer+1.6.0/components/">
<script xx_src="webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="polymer/polymer.html">
<link rel="import" href="x-foo.html">
</head>
<body>
<x-foo></x-foo>
</body>参见CodePen中的演示
热门推荐
1 训练狗狗憋尿
2 狗狗追踪训练
3 狗狗训练要多少钱
5 深圳狗狗训练
6 训练狗狗唤回
7 狗狗叫怎么训练
8 狗狗训练班
10 狗狗社会化训练
11 狗狗叫回训练
12 广州狗狗训练学校
13 狗狗训练躺下
14 狗狗随行训练
15 训练狗狗巡回
16 狗狗要怎么训练
17 狗狗喂食训练
18 训练狗狗躺下