Skip to content

Commit 550f982

Browse files
authoredSep 11, 2024··
feat: add migration logs for Vue2 app (#603)
1 parent 57a9e0b commit 550f982

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
 

‎packages/devtools-kit/src/core/index.ts

+15
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,21 @@ export function initDevTools() {
4343
}
4444
}
4545

46+
// @ts-expect-error skip type check
47+
// Vue2 app detection
48+
target.__VUE_DEVTOOLS_GLOBAL_HOOK__.once('init', (Vue) => {
49+
console.log('%c[_____Vue DevTools v7 log_____]', 'color: red; font-bold: 700; font-size: 20px;')
50+
51+
console.log('%cVue DevTools v7 detected in your Vue2 project. v7 only supports Vue3 and will not work.', 'font-bold: 700; font-size: 16px;')
52+
53+
const url = 'https://chromewebstore.google.com/detail/vuejs-devtools/iaajmlceplecbljialhhkmedjlpdblhp'
54+
console.log(`%cThe legacy version that supports both Vue 2 and Vue 3 has been moved to %c ${url}`, 'font-size: 16px;', 'text-decoration: underline; cursor: pointer;font-size: 16px;')
55+
56+
console.log('%cPlease install and enable only the legacy version for your Vue2 app.', 'font-bold: 700; font-size: 16px;')
57+
58+
console.log('%c[_____Vue DevTools v7 log_____]', 'color: red; font-bold: 700; font-size: 20px;')
59+
})
60+
4661
hook.on.setupDevtoolsPlugin((pluginDescriptor, setupFn) => {
4762
addDevToolsPluginToBuffer(pluginDescriptor, setupFn)
4863
const { app } = activeAppRecord ?? {}

0 commit comments

Comments
 (0)
Please sign in to comment.