vuejs / vue-web-component-wrapper

(Vue 2 only) Wrap a Vue component as a web component / custom element.
1.05k stars 99 forks source link

Options from the extended component are not inherited. #119

Open antoumpas opened 2 years ago

antoumpas commented 2 years ago

Hello,

Component options of the base component are not inherited when extending a component.

In the following example the browser throws an error "Error in created hook: "TypeError: Cannot set properties of undefined":

const baseComponent = {
  template: `<div>{{ test }}</div>`,
  props: {
    test: {
      type: Number,
    },
  },
};

const component = {
  extends: baseComponent,
};

customElements.define('my-element', wrap(Vue, component));