I am trying to add a library, vuedraggable, into my uibuilder for the KanBan feature.
The classic "import draggable from 'vuedraggable'" inside index.js is giving me the following error: Uncaught SyntaxError: Cannot use import statement outside a module
I have tried many things, but there seems to be no way for me to make this happen:(
To have this feature working would really be beneficial and make any UI experiences next level!
To be clear, imports DO work but only if you make your index.js a module by indicating such on the <script> tag. This is documented in the WIKI.
However, using the browser version is easier as indicated. If the component has been built properly, you shouldn't need to actually reference the file name. Try using unpkg.js rather than cdnjs. But also, if you have installed the module, you can change the ref from cdnjs to ../uibuilder/vendor/......
Opps .. forgot about that .. i think i blocked it from my memory because at the time i was straggling with Vue Single File Components using http-vue-loader and possibly it was http-vue-loader that had the issue with imports?!
You are right that http-vue-loader does not enable imports. It provides an alternative where you can load a .vue file remotely.
Using web components (e.g. the module setting that allows imports) means that you cannot use any version of IE or older browsers. However, support for most browsers, including mobile ones, is now very good. But not useful if you are stuck using an old Android tablet or phone as an extra display/controller.