Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

TarikAli's avatar

vue 3 composition api context root

I want to access the root instance (context.root) from a component gives undefined

app:
import router from '@/router';
import VueHtml2Canvas from 'vue-html2canvas';
const app = createApp(App);
const appRoot = app.use(router).use(VueHtml2Canvas).mount("#app");


component: 
export default {
    props: {
      t: String,
    },
    setup(props, context) {
        console.log(context.root)
     };
}



in options API : 
this.output = await this.$html2canvas(el, options);

but this doesn't work in composition api
0 likes
0 replies

Please or to participate in this conversation.