ElementUI / babel-plugin-component

Modular element-ui build plugin for babel.
452 stars 96 forks source link

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

Open Yueyun opened 6 years ago

Yueyun commented 6 years ago

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_helpersclassCallCheckdefault()(this, CanvasPoster);

i can fix this problem to change

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

does anyone know why this happen?

luchg commented 5 years ago

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