@@ -99,24 +99,29 @@ export default {
99
99
},
100
100
openInEditor () {
101
101
const file = this .target .file
102
- const src = ` fetch('/__open-in-editor?file=${ file} ').then(response => {
103
- if (response.ok) {
104
- console.log('File ${ file} opened in editor')
105
- } else {
106
- const msg = 'Opening component ${ file} failed'
107
- if (__VUE_DEVTOOLS_TOAST__) {
108
- __VUE_DEVTOOLS_TOAST__(msg, 'error')
102
+ // Console display
103
+ const fileName = file .replace (/ \\ / g , ' \\\\ ' )
104
+ if (file) {
105
+ const src = ` fetch('/__open-in-editor?file=${ encodeURI (file)} ').then(response => {
106
+ if (response.ok) {
107
+ console.log('File ${ fileName} opened in editor')
109
108
} else {
110
- console.log('%c' + msg, 'color:red')
109
+ const msg = 'Opening component ${ fileName} failed'
110
+ if (__VUE_DEVTOOLS_TOAST__) {
111
+ __VUE_DEVTOOLS_TOAST__(msg, 'error')
112
+ } else {
113
+ console.log('%c' + msg, 'color:red')
114
+ }
115
+ console.log('Check the setup of your project, see https://github.com/vuejs/vue-devtools/blob/master/docs/open-in-editor.md')
111
116
}
112
117
console.log('Check the setup of your project, see https://github.com/vuejs/vue-devtools/blob/master/docs/open-in-editor.md')
118
+ })`
119
+ if (this .$isChrome ) {
120
+ chrome .devtools .inspectedWindow .eval (src)
121
+ } else {
122
+ // eslint-disable-next-line no-eval
123
+ eval (src)
113
124
}
114
- })`
115
- if (this .$isChrome ) {
116
- chrome .devtools .inspectedWindow .eval (src)
117
- } else {
118
- // eslint-disable-next-line no-eval
119
- eval (src)
120
125
}
121
126
}
122
127
}
@@ -127,4 +132,3 @@ export default {
127
132
.title
128
133
white-space nowrap
129
134
</style >
130
-
0 commit comments