25
25
<slot name =" wgu-after-header" />
26
26
27
27
<wgu-app-sidebar v-if =" sidebarWins.length" v-bind =" sidebarConfig" >
28
- <template v-for =" (moduleWin , index ) in sidebarWins " >
28
+ <template v-for =" (moduleWin , index ) in sidebarWins " : key = " index " >
29
29
<component
30
- :is =" moduleWin.type" :key =" index"
31
30
v-bind =" moduleWin"
31
+ :is =" moduleWin.type"
32
32
/>
33
33
</template >
34
34
</wgu-app-sidebar >
35
35
36
36
<slot name =" wgu-before-content" />
37
37
<v-main app >
38
- <v-container id =" ol-map-container" fluid class =" fill-height pa-0" >
38
+ <v-container id =" ol-map-container" fluid class =" fill-height pa-0 position-relative " >
39
39
<wgu-map />
40
40
<!-- layer loading indicator -->
41
41
<wgu-maploading-status />
50
50
</v-container >
51
51
</v-main >
52
52
53
- <template v-for =" (moduleWin , index ) in floatingWins " >
53
+ <template v-for =" (moduleWin , index ) in floatingWins " : key = " index " >
54
54
<component
55
- :is =" moduleWin.type" :key =" index"
56
55
v-bind =" moduleWin"
56
+ :is =" moduleWin.type"
57
57
/>
58
58
</template >
59
59
77
77
</template >
78
78
79
79
<script >
80
- import Vue from ' vue'
81
- import { WguEventBus } from ' ../src/ WguEventBus'
82
- import OlMap from ' ../src/ components/ol/Map'
83
- import HoverTooltip from ' ../src/ components/ol/HoverTooltip'
84
- import AppHeader from ' ./components/AppHeader'
85
- import AppFooter from ' ./components/AppFooter'
86
- import AppSidebar from ' ./components/AppSidebar'
87
- import AppLogo from ' ../src/ components/AppLogo'
88
- import AppLoadingMask from ' ../src/ components/AppLoadingMask'
89
- import BgLayerSwitcher from ' ../src/ components/bglayerswitcher/BgLayerSwitcher.vue'
90
- import OverviewMap from ' ../src/ components/overviewmap/OverviewMap.vue'
91
- import MeasureWin from ' ../src/ components/measuretool/MeasureWin'
92
- import LayerListWin from ' ../src/ components/layerlist/LayerListWin'
93
- import HelpWin from ' ../src/ components/helpwin/HelpWin'
94
- import InfoClickWin from ' ../src/ components/infoclick/InfoClickWin'
95
- import MapLoadingStatus from ' ../src/ components/progress/MapLoadingStatus'
96
- import AttributeTableWin from ' ../src/ components/attributeTable/AttributeTableWin.vue'
97
- import MapRecorderWin from ' ../src/ components/maprecorder/MapRecorderWin'
98
- import SampleModuleWin from ' ./components/SampleModule.vue'
80
+ import { getCurrentInstance } from ' vue' ;
81
+ import { WguEventBus } from ' @/ WguEventBus' ;
82
+ import OlMap from ' @/ components/ol/Map' ;
83
+ import HoverTooltip from ' @/ components/ol/HoverTooltip' ;
84
+ import AppHeader from ' ./components/AppHeader' ;
85
+ import AppFooter from ' ./components/AppFooter' ;
86
+ import AppSidebar from ' ./components/AppSidebar' ;
87
+ import AppLogo from ' @/ components/AppLogo' ;
88
+ import AppLoadingMask from ' @/ components/AppLoadingMask' ;
89
+ import BgLayerSwitcher from ' @/ components/bglayerswitcher/BgLayerSwitcher.vue' ;
90
+ import OverviewMap from ' @/ components/overviewmap/OverviewMap.vue' ;
91
+ import MeasureWin from ' @/ components/measuretool/MeasureWin' ;
92
+ import LayerListWin from ' @/ components/layerlist/LayerListWin' ;
93
+ import HelpWin from ' @/ components/helpwin/HelpWin' ;
94
+ import InfoClickWin from ' @/ components/infoclick/InfoClickWin' ;
95
+ import MapLoadingStatus from ' @/ components/progress/MapLoadingStatus' ;
96
+ import AttributeTableWin from ' @/ components/attributeTable/AttributeTableWin.vue' ;
97
+ import MapRecorderWin from ' @/ components/maprecorder/MapRecorderWin' ;
98
+ import SampleModuleWin from ' ./components/SampleModule.vue' ;
99
99
100
100
export default {
101
101
name: ' wgu-app-tpl' ,
@@ -118,14 +118,18 @@ export default {
118
118
' wgu-maprecorder-win' : MapRecorderWin,
119
119
' sample-module-win' : SampleModuleWin
120
120
},
121
+ setup () {
122
+ const vueInstance = getCurrentInstance ();
123
+ return { vueInstance };
124
+ },
121
125
data () {
122
126
return {
123
127
isEmbedded: false ,
124
128
sidebarConfig: this .getSidebarConfig (),
125
129
overviewMapConfig: this .getOverviewMapConfig (),
126
130
floatingWins: this .getModuleWinData (' floating' ),
127
131
sidebarWins: this .getModuleWinData (' sidebar' ),
128
- showCopyrightYear: Vue . prototype .$appConfig .showCopyrightYear
132
+ showCopyrightYear: this .$appConfig .showCopyrightYear
129
133
}
130
134
},
131
135
created () {
@@ -143,7 +147,7 @@ export default {
143
147
for (const key of Object .keys (refs)) {
144
148
cmpLookup[key] = refs[key][0 ];
145
149
}
146
- Vue . prototype .cmpLookup = cmpLookup;
150
+ this . vueInstance . appContext . config . globalProperties .cmpLookup = cmpLookup;
147
151
// inform registered cmps that the app is mounted and the dynamic
148
152
// components are available
149
153
WguEventBus .$emit (' app-mounted' );
@@ -154,15 +158,15 @@ export default {
154
158
* @return {Object} Sidebar configuration object.
155
159
*/
156
160
getSidebarConfig () {
157
- const appConfig = Vue . prototype .$appConfig || {};
161
+ const appConfig = this .$appConfig || {};
158
162
return appConfig .sidebar ;
159
163
},
160
164
/**
161
165
* Returns the configuration object for the overview map from app-config.
162
166
* @return {Object} Overview map configuration object.
163
167
*/
164
168
getOverviewMapConfig () {
165
- const appConfig = Vue . prototype .$appConfig || {};
169
+ const appConfig = this .$appConfig || {};
166
170
return appConfig .overviewMap ;
167
171
},
168
172
/**
@@ -175,7 +179,7 @@ export default {
175
179
* @return {Array} module window configuration objects
176
180
*/
177
181
getModuleWinData (target ) {
178
- const appConfig = Vue . prototype .$appConfig || {};
182
+ const appConfig = this .$appConfig || {};
179
183
const modulesConfs = appConfig .modules || {};
180
184
const moduleWins = [];
181
185
for (const key of Object .keys (modulesConfs)) {
@@ -199,7 +203,7 @@ export default {
199
203
* Sets the current i18n language to the global app language lookup.
200
204
*/
201
205
setGlobalAppLang () {
202
- Vue . prototype .$appLanguage = this .$i18n .locale ;
206
+ this . vueInstance . appContext . config . globalProperties .$appLanguage = this .$i18n .locale ;
203
207
}
204
208
},
205
209
watch: {
@@ -211,5 +215,5 @@ export default {
211
215
this .setDocumentTitle ();
212
216
}
213
217
}
214
- }
218
+ };
215
219
</script >
0 commit comments