@@ -101,27 +101,25 @@ export default {
101
101
const file = this .target .file
102
102
// Console display
103
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')
104
+ const src = ` fetch('/__open-in-editor?file=${ encodeURI (file)} ').then(response => {
105
+ if (response.ok) {
106
+ console.log('File ${ fileName} opened in editor')
107
+ } else {
108
+ const msg = 'Opening component ${ fileName} failed'
109
+ if (__VUE_DEVTOOLS_TOAST__) {
110
+ __VUE_DEVTOOLS_TOAST__(msg, 'error')
108
111
} else {
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')
112
+ console.log('%c' + msg, 'color:red')
116
113
}
117
114
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)
124
115
}
116
+ console.log('Check the setup of your project, see https://github.com/vuejs/vue-devtools/blob/master/docs/open-in-editor.md')
117
+ })`
118
+ if (this .$isChrome ) {
119
+ chrome .devtools .inspectedWindow .eval (src)
120
+ } else {
121
+ // eslint-disable-next-line no-eval
122
+ eval (src)
125
123
}
126
124
}
127
125
}
0 commit comments