Vue 3 trying to pass data() params using createApp function not working

  Kiến thức lập trình
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: ''
        }
    },

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT