作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用MeteorJS进行编码,并使用Google的Polymer作为前端框架,Polymer Web组件语法包含<template>
标记
<dom-module>
<template>
<!-- html code -->
</template>
</dom-module>
<template>
中写入
<dom-module>
标记并显示错误
While processing files with templating (for target web.browser):
client/test.html:1: Expected one of: <body>, <head>, <template>
最佳答案
以下对我有用。
将所有与Polymer相关的文件放在Meteor应用程序的public
文件夹中。像这样:
.
├── .meteor
├── client
├── server
└── public
├── bower.json
├── bower_components
│ ├── iron-icons
│ ├── polymer
│ ├── webcomponentsjs
│ └── web-component-tester
└── elements
└── elements.html
head
标记中:
<script src="/bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="/elements/elements.html">
elements.html
文件中导入所有Polymer元素:
<link rel="import" href="../bower_components/iron-icons/iron-icons.html">
关于javascript - 我如何在MeteorJS中使用Web组件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34313557/
我是一名优秀的程序员,十分优秀!