Subscribe on changes!

Setup data overwrites data in component

avatar
Apr 28th 2021

What problem does this feature solve?

It allows the api composition function to set values for variables in data, and if the api composition function does not allow them, then data() in the component can set them in default.

What does the proposed API look like?

export default {
  name: 'job-edit',
  setup() {
    const data = reactive({
      id: 42,
    });
    return data;
  },
  data() {
    return {
    id: null,
  }
}

I want the value to be 42, rather than null.

avatar
Apr 28th 2021

This is expected and you should not combine the composition api with the option api.


Remember to use the forum or the Discord chat to ask questions!