Reputation: 5816
Usually I can trigger UIkit functions from the console like:
UIkit.alert('.myalert').close();
I have this small example where I use UIkit and a dummy function. When compiling this i no longer have access over the console:
import UIkit from 'uikit';
import Icons from './uikit/uikit-icons';
UIkit.use(Icons);
import Myfunction from './myfunction';
document.addEventListener('DOMContentLoaded', () => {
Myfunction('something');
})
I added this to export UIkit with no luck:
export default { UIkit };
Upvotes: 0
Views: 155
Reputation: 507
I believe it has to be export default UIkit;
Because now you export an object with UIkit
being it's key.
But you also need to import UIkit
to myfunction
as well.
Upvotes: 0