export function $new(cls, params) {
// Define the component using the given class
const ComponentClass = defineComponent(cls);
// Create an application instance with the component
const app = createApp(ComponentClass, params);
// Mount the app and get the component instance
const instance = app.mount(document.createElement('div'));
return instance;
}
The variables passed in params is {icon: “data”} and is not working in Vue 3.
The component has
data: function () {
return {
value: false,
icon: ''
}
},