Subscribe on changes!

The method " setup(props, context) " of the parent component does not be called.

avatar
Oct 28th 2020

Version

3.0.2

Steps to reproduce

parent component

  created() {
    console.log("created base");
  },
  setup(props, context) {
    console.log("setup base");
  }
}

child component

import SDBase from "../../base/src/index.vue";

  extends: SDBase,
  created() {
    console.log("created child");
  },
  setup(props, context) {
    console.log("setup child");
  }
}

Google Chrome console: image

What is expected?

The method " setup(props, context) " of the parent component can be called.

What is actually happening?

The method " setup(props, context) " of the parent component does not be called.

avatar
Oct 28th 2020

This is expected behavior. setup() is not part of the options API and is excluded from any form of options-based composition/inheritance.

If you use setup(), composition should happen via Composition API.