我正在尝试在带有 angular-cli 的 angular2 应用程序中使用 Dragula。
<script src="vendor/dragula/dist/dragula.min.js"></script>
<script src="vendor/es6-shim/es6-shim.js"></script>
<script src="vendor/systemjs/dist/system-polyfills.js"></script>
<script src="vendor/angular2/bundles/angular2-polyfills.js"></script>
<script src="vendor/systemjs/dist/system.src.js"></script>
<script src="vendor/rxjs/bundles/Rx.js"></script>
<script src="vendor/angular2/bundles/angular2.dev.js"></script>
<script src="vendor/angular2/bundles/http.dev.js"></script>
<script src="vendor/angular2/bundles/router.dev.js"></script>
<script>
System.config({
packages: {
app: {
format: 'register',
defaultExtension: 'js'
}
},
paths: {
dragula: 'vendor/dragula/dist/dragula.min.js'
}
});
System.import('app.js').then(null, console.error.bind(console));
</script>
当我像这样导入dragula时:
import * as dragula from 'dragula';
并尝试使用我得到dragula is not a function
错误