Search code examples
typescriptvue.jsstorybook

Set type description in typescript vuejs


This throws 'description' does not exist in PropValidator

export default Vue.extend( {
  name: 'something',
  props: {
    'backgroundColor': {
      type: String,
      description: 'What background color to use'
     },

To get this in storybook enter image description here


Solution

  • Answer is https://github.com/vue-styleguidist/vue-styleguidist/tree/dev/packages/vue-docgen-api#props

    export default Vue.extend( {
      name: 'something',
      props: {
         /**
         * 'What background color to use'
         */
        'backgroundColor': {
          type: String
         },
    

    Has to be multi-line comment inline comment doesn't work