vue-router icon indicating copy to clipboard operation
vue-router copied to clipboard

Specifying one single value for the props property with named views

Open green-coder opened this issue 6 years ago • 0 comments

What problem does this feature solve?

When passing from a component to multiple (named) ones, we also need to change the way the props property is defined. If the user of the lib is not aware of that change, the props are not passed to his components anymore and his program stops to work normally.

This code break can be avoided if we interpret the single-component prop config as valid for multiple-components by extension.

What does the proposed API look like?

  components: {
    default: MyComponent,
    sideBar: MySideBar
  },
  props: {
    default: true,
    sideBar: true
  },

could be written as:

  components: {
    default: MyComponent,
    sideBar: MySideBar
  },
  props: true,

The same for the function-based version of props.

green-coder avatar Oct 03 '17 02:10 green-coder