Skip to content

Commit 584b032

Browse files
committed
fix issue when used with importmap as DomContentLoaded is fired twice when using es shims module
1 parent d9d807c commit 584b032

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/matestack/ui/vue_js/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import axios from 'axios'
12
import eventHub from './event_hub'
23
const matestackEventHub = eventHub // for compatibility with 1.x
34

@@ -68,14 +69,18 @@ const registerComponents = function(appInstance){
6869
}
6970

7071
const mount = function(appInstance, elementId='#matestack-ui'){
71-
registerComponents(appInstance)
72+
if (window.matestackAppMounted != true){
73+
window.matestackAppMounted = true
74+
registerComponents(appInstance)
7275

73-
appInstance.mount(elementId)
76+
appInstance.mount(elementId)
77+
}
7478

7579
return appInstance
7680
}
7781

7882
const MatestackUiVueJs = {
83+
axios,
7984
eventHub,
8085
matestackEventHub, // for compatibility with 1.x
8186
componentMixin,

0 commit comments

Comments
 (0)