File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- // import * as Vue from 'vue'
2- import Vue from 'vue'
3- import App from 'virtual:vue-inspector-path:Overlay.vue'
41import inspectorOptions from 'virtual:vue-inspector-options'
2+ import App from 'virtual:vue-inspector-path:Overlay.vue'
53
64const CONTAINER_ID = 'vue-inspector-container'
75
@@ -15,29 +13,21 @@ function createInspectorContainer() {
1513 return el
1614}
1715
18- function load ( ) {
16+ async function load ( ) {
1917 const isClient = typeof window !== 'undefined'
2018 if ( ! isClient )
2119 return
2220 createInspectorContainer ( )
2321 const { vue } = inspectorOptions
22+ // console.log('load inspectorOptions', vue, `loadVue${vue}`)
2423
25- console . log ( 'load inspectorOptions' , inspectorOptions )
24+ let res = { }
25+ if ( vue === 3 )
26+ res = await import ( './loadVue3.js' )
27+ else
28+ res = await import ( './loadVue2.js' )
2629
27- // vue 2/3 compatibility
28- vue === 3
29- ? Vue . createApp ( {
30- render : ( ) => Vue . h ( App ) ,
31- devtools : {
32- hide : true ,
33- } ,
34- } ) . mount ( `#${ CONTAINER_ID } ` )
35- : new Vue ( {
36- render : h => h ( App ) ,
37- devtools : {
38- hide : true ,
39- } ,
40- } ) . $mount ( `#${ CONTAINER_ID } ` )
30+ res . loadVue ( CONTAINER_ID , App )
4131}
4232
4333if ( inspectorOptions . lazyLoad )
Original file line number Diff line number Diff line change 1+ import Vue from 'vue'
2+
3+ export function loadVue ( CONTAINER_ID , App ) {
4+ new Vue ( {
5+ render : h => h ( App ) ,
6+ devtools : {
7+ hide : true ,
8+ } ,
9+ } ) . $mount ( `#${ CONTAINER_ID } ` )
10+ }
Original file line number Diff line number Diff line change 1+ import * as Vue from 'vue'
2+
3+ export function loadVue ( CONTAINER_ID , App ) {
4+ Vue . createApp ( {
5+ render : ( ) => Vue . h ( App ) ,
6+ devtools : {
7+ hide : true ,
8+ } ,
9+ } ) . mount ( `#${ CONTAINER_ID } ` )
10+ }
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ export default defineConfig({
99 Vue ( ) ,
1010 VueJsx ( ) ,
1111 Inspector ( {
12- enabled : true ,
1312 toggleButtonVisibility : 'always' ,
1413 launchEditor : 'code' ,
1514 } ) ,
You can’t perform that action at this time.
0 commit comments