【发布时间】:2019-12-06 18:11:16
【问题描述】:
我正在尝试遵循these 使用 Web 组件的说明。我使用npm install --save @polymer/paper-button 安装了聚合物纸按钮,将以下内容添加到我的 index.html 并使用 vscode 的实时服务器打开它。但我收到一个控制台错误消息:Uncaught TypeError: Failed to resolve module specifier "@polymer/iron-flex-layout/iron-flex-layout.js". Relative references must start with either "/", "./", or "../".。我想在不使用 webpack 之类的模块捆绑器的情况下解决这个问题。
<script type="module" src="node_modules/@polymer/paper-button/paper-button.js"></script>
...
<paper-button raised class="indigo">raised</paper-button>
【问题讨论】:
标签: javascript polymer web-component polymer-3.x