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

Commit 0cf3774

Browse files
committed
Updated README
1 parent ccdc2cc commit 0cf3774

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

README.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,10 @@ we are getting this output:
365365

366366
```
367367

368-
## Mixins
369-
If you import a mixin, for it to be documented you need to add in the header the mixin tag **@mixin**, for example
368+
## Mixins or Extends
369+
If you import a [mixin](https://vuejs.org/v2/guide/mixins.html) or [extends](https://vuejs.org/v2/api/#extends), for it to be documented you need to add in the header the mixin tag **@mixin**, for example
370+
371+
Case Mixin:
370372

371373
```javascript
372374
// src/mixins/colorMixin.js
@@ -387,6 +389,35 @@ module.exports = {
387389
}
388390
```
389391

392+
Case Extends:
393+
394+
```vue
395+
// src/extends/Base.vue
396+
397+
<template>
398+
<div>
399+
<h4>{{ color }}</h4>
400+
<!--the appropriate input should go here-->
401+
</div>
402+
</template>
403+
<script>
404+
/**
405+
* @mixin
406+
*/
407+
export default {
408+
props: {
409+
/**
410+
* The color for the button example
411+
*/
412+
colorExtends: {
413+
type: String,
414+
default: '#333'
415+
},
416+
},
417+
}
418+
</script>
419+
```
420+
390421
```html
391422
<template>
392423
<!-- -->
@@ -395,9 +426,11 @@ module.exports = {
395426
// src/components/Button/Button.vue
396427
397428
import colorMixin from '../../mixins/colorMixin';
429+
import Base from '../../extends/Base';
398430
export default {
399431
name: 'buttonComponent',
400432
mixins: [colorMixin],
433+
extends: Base,
401434
props: {
402435
/**
403436
* The size of the button

0 commit comments

Comments
 (0)