Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only open file if it's a full path #714

Merged
merged 1 commit into from
Jul 31, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/devtools/views/components/ComponentInspector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<span>Inspect DOM</span>
</a>
<a
v-if="target.file"
v-tooltip="target.file && $t('ComponentInspector.openInEditor.tooltip', { file: target.file })"
v-if="fileIsPath"
v-tooltip="$t('ComponentInspector.openInEditor.tooltip', { file: target.file })"
class="button"
@click="openInEditor"
>
Expand Down Expand Up @@ -100,6 +100,12 @@ export default {
[el.key]: el.value
}, this.filter)
})), 'type')
},

// Checks if the file is actually a path (e.g. '/path/to/file.vue'), or
// only the basename of a pre-compiled 3rd-party component (e.g. 'file.vue')
fileIsPath () {
return this.target.file && /[/\\]/.test(this.target.file)
}
},

Expand Down