Transpiling class based web components with babel

前端 未结 2 490
礼貌的吻别
礼貌的吻别 2021-01-02 01:12

I\'ve a simple web component following the latest web components v1 class syntax, it works great in Chrome and Firefox/Edge (with a polyfill) but I\'d like it to run in IE11

2条回答
  •  无人及你
    2021-01-02 01:44

    To compile Custom Element classes with Babel, you can use this plugin from Github.

    It will use Reflect.construct() instead of new, which is not permitted with HTMLElement objects.

提交回复
热议问题