Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Custom type for props #3

Open
ozum opened this issue Nov 29, 2018 · 0 comments
Open

Feature request: Custom type for props #3

ozum opened this issue Nov 29, 2018 · 0 comments

Comments

@ozum
Copy link

ozum commented Nov 29, 2018

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 },
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant