问题描述
当我尝试加载vaadin自定义元素按钮时,由于收到错误消息(0,$csb__dommodule.DomModule).import is not a function
,有人可以帮助我并在这里告诉我我做错了什么吗? TYVM:)
import "@vaadin/vaadin-button";
document.getElementById("app").innerHTML = `
<h4>Vaadin Button</h4>
<section>
<vaadin-button>This is a button</vaadin-button>
</section>
`;
https://codesandbox.io/s/recursing-swartz-tbe4y?file=/src/index.js
解决方法
这是Codesanbox的特定问题。如果您在本地运行沙箱,则可以正常运行。我刚刚测试过
步骤:
- 导出沙箱
- 运行
npm i
- 运行
npm start
我刚刚在codeandbox客户端存储区中创建了this issue。
正在工作的webcomponents.dev演示:https://webcomponents.dev/edit/RvnCgQUcXyckBJdjBCgl