Skip to content
This repository was archived by the owner on Mar 8, 2019. It is now read-only.

Releases: vue-styleguidist/vue-docgen-api

Support documentation of extends

20 Apr 20:53
Compare
Choose a tag to compare

Document Extends

If you import extends, for it to be documented you need to add in the header the mixin tag @mixin, for example

// src/extends/Base.vue

<template>
  <div>
    <h4>{{ color }}</h4>
    <!--the appropriate input should go here-->
  </div>
</template>
<script>
/**
 * @mixin
 */
export default {
  props: {
    /**
    * The color for the button example
    */
    colorExtends: {
      type: String,
      default: '#333'
    },
  },
}
</script>
<template>
<!-- -->
</template>
<script>
// src/components/Button/Button.vue

import Base from '../../extends/Base';
export default {
  name: 'buttonComponent',
  extends: Base,
  props: {
    /**
    * The size of the button
    * `small, normal, large`
    */
    size: {
      default: 'normal'
    },
    /**
    * Add custom click actions.
    **/
    onCustomClick: {
      default: () => () => null,
    },
  },
  /* ... */
}
</script>

Updated slots documentation

01 Dec 22:41
Compare
Choose a tag to compare
  • Fixed: Fix array prop
  • Feat: Added parseSource #14
  • Updated: Slots documentation #12

Breaking changes

In this version, for documentation slot, you need to add @slots in the template.

AFTER

<template>
  <div>
    <!-- Use slot header -->
    <slot name="header"></slot>

    <!-- Use slot footer -->
    <slot name="footer"></slot>
  </div>
</template>

BEFORE

<template>
  <div>
    <!-- @slot Use slot header -->
    <slot name="header"></slot>

    <!-- @slot Use slot footer -->
    <slot name="footer"></slot>
  </div>
</template>

Added documentation of slots

28 Oct 09:27
Compare
Choose a tag to compare

Slot

input in component

<template>
  <div>
    <!-- Use slot header -->
    <slot name="header"></slot>

    <!-- Use slot footer -->
    <slot name="footer"></slot>
  </div>
</template>

output in JSON

"slots": {
    "header": {
      "description": "Use this slot header"
    },
    "footer": {
      "description": "Use this slot footer"
    }
}

Added event support

01 Oct 06:58
Compare
Choose a tag to compare
  • Fixed: some bugs
  • Added: Model in props
  • Added: Events documentation

Model in prop

input in component

export default {
  props: {
    /**
     * Model example
     * @model
     */
    value: {
      type: String,
      required: true
    }
  }
  /* ... */
}

output in JSON

"v-model": {
  "required": "true",
  "type": {
    "name": "string"
  },
  "description": "Model example"
}

Events

input in component

/**
 * Success event.
 *
 * @event success
 * @type {object}
 */
this.$emit('success', {
  demo: 'example',
})

output in JSON

"events": {
  "success": {
    "description": "Success event.",
    "type": {
      "names": [
        "object"
      ]
    },
    "comment": "/**\n     * Success event.\n     *\n     * @event success\n     * @type {object}\n     */"
  }
}

v2.0.12

24 Aug 03:13
Compare
Choose a tag to compare
  • Removed parseWebpack

v2.0.11

25 Jul 20:44
Compare
Choose a tag to compare

v2.0.9

17 Jul 15:28
Compare
Choose a tag to compare
  • Fix: Allow collection of prop default value when set to false #7

v2.0.8

13 Jul 22:16
Compare
Choose a tag to compare
  • Updated: vue-webpack-loaders

v2.0.7-globals

13 Jul 22:15
Compare
Choose a tag to compare
  • Update: Extract global components documentation

v2.0.6

09 Jul 01:39
Compare
Choose a tag to compare
  • Fix: Async error #5