Skip to content

[Base] Add support for multiple option type #651

@titouanmathis

Description

@titouanmathis

Sometimes an option can be either a number or an array of numbers. Having the ability to specify both types could be useful:

class Component extends Base {
  static config = {
    name: 'Component',
    options: {
      offset: [Number, Array],
    },
  };
}

The option could then be used with a number or an array:

<div data-component="Component" 
  data-option-offset="10">
  ...
</div>

<div data-component="Component" 
  data-option-offset="[10, 20]">
  ...
</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions