devtools
devtools copied to clipboard
setupDevtoolsPlugin method not worked sometime
I write a plugin for devtools, when I use
import { setupDevtoolsPlugin } from '@vue/devtools-api'
setupDevtoolsPlugin({
id: 'some_id',
label: 'some_label',
packageName: 'launch-editor',
app,
}, (api) => {
console.log('🚀 ~ setupDevtools ~ api:', api)
api.on.inspectComponent((payload, context) => {
console.log('🚀 ~ setupDevtools ~ payload:', payload)
})
Sometime the log does not print, but I refresh the page almost it can print.
Does devtools have caching ?
I tried both 6.0.0-beta.11 and the latest version
Can you provide a mini repo? 🙏
Same here. I ran into a problem with vue-i18n not completing the plugin install in dev mode because setupDevtoolsPlugin never calling the callback function.
If I call createI18n in my "main" application.js like this, it works without a problem:
const i18n = createI18n({
availableLocales: Object.keys(translations),
locale,
fallbackLocale: defaultLocale,
messages: translations,
globalInjection: true,
});
app.use(i18n);
But when i18n instance is created in another module setupDevtoolsPlugin never calls the callback:
// i18n.js
export const i18n = createI18n({
availableLocales: Object.keys(translations),
locale,
fallbackLocale: defaultLocale,
messages: translations,
globalInjection: true,
});
//main.js
import {i18n} from './i18n.js'
app.use(i18n);