聚合物不起作用或不显示任何元素

编程入门 行业动态 更新时间:2024-10-27 04:32:12
本文介绍了聚合物不起作用或不显示任何元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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>

更多推荐

聚合物不起作用或不显示任何元素

本文发布于:2023-08-02 17:10:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1279607.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:聚合物   或不   不起作用   元素

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!