babel-plugin-component
babel-plugin-component copied to clipboard
import 'class' constructor, console ok, but new class is not defined
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?
我也遇到了一模一样的问题!