File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
packages/@vuepress/plugin-theme-data Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 2929 "copy" : " cpx \" src/**/*.d.ts\" lib"
3030 },
3131 "dependencies" : {
32+ "@vue/devtools-api" : " ^6.0.0-beta.21.1" ,
3233 "@vuepress/client" : " 2.0.0-beta.33" ,
3334 "@vuepress/core" : " 2.0.0-beta.33" ,
3435 "@vuepress/shared" : " 2.0.0-beta.33" ,
Original file line number Diff line number Diff line change 1+ import { setupDevtoolsPlugin } from '@vue/devtools-api'
12import { defineClientAppEnhance , routeLocaleSymbol } from '@vuepress/client'
23import { computed } from 'vue'
34import {
@@ -28,4 +29,37 @@ export default defineClientAppEnhance(({ app }) => {
2829 } ,
2930 } ,
3031 } )
32+
33+ // setup devtools in dev mode
34+ if ( __VUEPRESS_DEV__ || __VUE_PROD_DEVTOOLS__ ) {
35+ setupDevtoolsPlugin (
36+ {
37+ app,
38+ id : 'org.vuejs.vuepress.plugin-theme-data' ,
39+ label : 'VuePress Theme Data Plugin' ,
40+ packageName : '@vuepress/plugin-theme-data' ,
41+ homepage : 'https://v2.vuepress.vuejs.org' ,
42+ logo : 'https://v2.vuepress.vuejs.org/images/hero.png' ,
43+ componentStateTypes : [ 'VuePress' ] ,
44+ } ,
45+ ( api ) => {
46+ api . on . inspectComponent ( ( payload ) => {
47+ payload . instanceData . state . push (
48+ {
49+ type : 'VuePress' ,
50+ key : 'themeData' ,
51+ editable : false ,
52+ value : themeData . value ,
53+ } ,
54+ {
55+ type : 'VuePress' ,
56+ key : 'themeLocaleData' ,
57+ editable : false ,
58+ value : themeLocaleData . value ,
59+ }
60+ )
61+ } )
62+ }
63+ )
64+ }
3165} )
You can’t perform that action at this time.
0 commit comments