聚合物不起作用或不显示任何元素 [英] polymer not working or displaying no elements

查看:79
本文介绍了聚合物不起作用或不显示任何元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用元素显示世界,但没有任何帮助吗?

Trying to display hello world using elements but nothing happens any help?

index.html

index.html

<!DOCTYPE html>
<html>
	<head>
	<meta name="viewport"
    content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">

  <script src="bower_components/webcomponentsjs/webcomponents.js"></script>
		<link rel="import" href="elements/hello-world.html">
	</head>	
<body unresolved>
<hello-world></hello-world>
</body>
</html>

hello-world.html

hello-world.html

<link rel="import" href="../bower_components/polymer/polymer.html">

<polymer-element name="hello-world" nonscript>
	<template>
			<h2>Hello World</h2>
	</template>
</polymer-element>

推荐答案

"hello-world.html"的代码现在为:

Code for "hello-world.html" is now:

  <link rel="import" href="../bower_components/polymer/polymer.html">
 <dom-module id="hello-world">
 <template>
 <h1>Hello World</h1> 
</template>
 <script>
 Polymer ({ is: "hello-world", }); 
</script>
 </dom-module>

这篇关于聚合物不起作用或不显示任何元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆