本文介绍了聚合物不起作用或不显示任何元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试使用元素显示世界,但没有任何帮助吗?
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>更多推荐
聚合物不起作用或不显示任何元素
发布评论