User:Plantaest/TestVue.js

// if (	mw.config.values.wgCanonicalNamespace === 'Special'   && mw.config.values.wgCanonicalSpecialPageName === 'Blankpage'    && mw.config.values.wgTitle.endsWith('/Vue') ) { mw.loader.using(['vue', '@wikimedia/codex']).then(function (require) {       const Vue = require('vue');        const Codex = require('@wikimedia/codex');

const store = Vue.reactive({           count: 0,            increment {                this.count++;            },        });

const App = Vue.createMwApp({           template: `                                    `,        });

App.component('component-a', {           template: `                              From A:                           `,            setup:  => ({ store }),            components: {                CdxButton: Codex.CdxButton,            },        });

App.component('component-b', {           template: `                              From B:                           `,            setup:  => ({ store }),            components: {                CdxButton: Codex.CdxButton,            },        });

App.mount('#content'); }); } //