Skip to content

Feature request: Custom type for props #3

@ozum

Description

@ozum

Hi,

Thanks for the project. I have a feature request please.

It would be great if we could provide custom types for props, because some props requires complex objects and documenting them would be great.

Kind Regards,

For example:

  /**
   * @typedef {Object} Currency
   * @property {string}   symbol   - Symbol of the currency
   * @property {string}   name     - Name of the currency
   */

export default {
  props: {
    /**
     * @model
     * @property {string[]}   selected      - Array of ids of selected options.
     * @property {number}     quantity	    - Number of item requested.
     */
    value: {
      type: Object,
      default: () => ({
        selected: [],
        quantity: 1,
      }),
    },
    
    /**
     * Description for the prop
     * @type Currency
     */
    currency: { type: Object, required: true },

    /**
     * Description with Inline type
     * @property {string}    code    - Color code
     * @property {number}    sort    - Sort number of the color
     */
    color: { type: Object, required: true },
  }
}

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