Skip to content

Commit

Permalink
feat: Add a setting for "vue-devtools Detected Vue" console log, closes
Browse files Browse the repository at this point in the history
vuejs#685 (vuejs#811)

* feat: Add a setting for "vue-devtools Detected Vue" console log, closes vuejs#685

* Fix check for cold storage

* fix: use SharedData

* refactor: invert setting


Co-authored-by: Guillaume Chau <alphadelta.fg@gmail.com>
  • Loading branch information
2 people authored and iksim committed Apr 18, 2019
1 parent c45ab5b commit 40ef688
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
14 changes: 8 additions & 6 deletions src/backend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,14 @@ function connect (Vue) {

bridge.log('backend ready.')
bridge.send('ready', Vue.version)
console.log(
`%c vue-devtools %c Detected Vue v${Vue.version} %c`,
'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff',
'background:#41b883 ; padding: 1px; border-radius: 0 3px 3px 0; color: #fff',
'background:transparent'
)
if (SharedData.logDetected) {
console.log(
`%c vue-devtools %c Detected Vue v${Vue.version} %c`,
'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff',
'background:#41b883 ; padding: 1px; border-radius: 0 3px 3px 0; color: #fff',
'background:transparent'
)
}

setTimeout(() => {
scan()
Expand Down
9 changes: 9 additions & 0 deletions src/devtools/views/settings/GlobalPreferences.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@
Enable <span class="dim">(may print warnings)</span>
</VueSwitch>
</VueFormField>

<VueFormField title="Detected Vue message">
<VueSwitch
:value="$shared.logDetected"
@input="$shared.logDetected = $event"
>
Display in browser console
</VueSwitch>
</VueFormField>
</div>
</template>

Expand Down
6 changes: 4 additions & 2 deletions src/shared-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ const internalSharedData = {
cacheVuexSnapshotsLimit: 10,
snapshotLoading: null,
recordPerf: false,
editableProps: false
editableProps: false,
logDetected: true
}

const persisted = [
'classifyComponents',
'theme',
'displayDensity',
'recordVuex',
'editableProps'
'editableProps',
'logDetected'
]

// ---- INTERNALS ---- //
Expand Down

0 comments on commit 40ef688

Please sign in to comment.