How do I rewrite vue2 code to new version(vue3)?

Viewed 27

I'm trying to rewrite old vue 2 code to vue3. There is MVC integration with vue. I have a component loader:

import Vue from 'vue';
import About from './AboutView.vue';

export function load() {
    const selector = 'sandbox-about';

    // Is the custom Vue root element in the DOM?

    if (!document.querySelector(selector)) {
        return;
    }

    // Create a new Vue app with the imported Home component

    new Vue({
        render: createElement =>
            createElement(About, {
                props: {
                    ...window[selector],
                },
            }),
    }).$mount(selector)
}

How to change code lines which start with new Vue to vue 3?

0 Answers
Related