ElementUI / babel-plugin-component

Modular element-ui build plugin for babel.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

import 'class' constructor, console ok, but new class is not defined

Yueyun opened this issue · comments

I'm using babel-plugin-component
here's my import
import {CanvasPoster} from 'ui-lib'
but when I using this: new CanvasPoster()
it says

myPoster.vue?7d2b:33 Uncaught (in promise) ReferenceError: CanvasPoster is not defined

but i can console.log(CanvasPoster)

function CanvasPoster() {
__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_classCallCheck___default()(this, CanvasPoster);

i can fix this problem to change

import CanvasPoster from 'ui-lib/lib/CanvasPoster',

does anyone know why this happen?

commented

我也遇到了一模一样的问题!