import Button from 'my-library/dist/components/Button/Button.vue'

The only true button.

Prop nameDescriptionValuesDefaultOrigin
color

The color for the button.

string

-

#333

inMixin

This prop comes from the loginMixin mixin

boolean

-

true

M: loggerMixin
propArrayDefault

A test for default function Array

array

-

[1, 2, 3]

propComplexDefault

A test for default function more complex

array

-

Function

propObjectDefault

A test for default function Object

object

-

{}

shape

The shape of my heart

PropTypes.shape({
    color: PropTypes.string,
    fontSize: PropTypes.number
})

-

-

size

The size of the button

VueTypes.string.def('normal')

small, normal, large

-

SlotDescription
default

content of the button

Basic button:

Big pink button and small blue button:

And you can use any Markdown here.

Fenced code blocks with vue, html, js, jsx or javascript languages are rendered as a interactive playgrounds:

You can also use the Single File Component Format


Next Dog Name: Bella

another example with the new Vue({}) format


Count: 42

This is an examples doc file Button

You can add a custom classes to an example wrapper (```js { "className": "checks" }):

Or disable an editor by passing a noeditor modifier (```js noeditor):

To render an example as highlighted source code add a static modifier: (```js static):

import Vue from 'vue'

Fenced blocks with other languages are rendered as highlighted code:

<h1>Hello world</h1>

Conclusion

Let's build a button.

import CounterButton from 'my-library/dist/components/CounterButton/CounterButton.vue'

Button that counts how many times it was pressed and exposes a @public method to reset itself.

Prop nameDescriptionDefault
menuItems
array

[]

Method nameDescriptionParameters
set()

Sets the counter to a particular value.

Returns: stringTest
Throwsthrows this when needed
ThrowsInvalidArgumentwhen the newValue is null
Version1.0.5
newValue: NumberNew value for the counter
target: Objecttarget of the counter
Event nameDescriptionProperties
after

After increment event

<anonymous1>: number
<anonymous2>: undefined
import DropDown from 'my-library/dist/components/DropDown/DropDown.vue'
RequiresMyOption
SlotDescription
default

where the options will be listed

A drop down is composed of mutiple components.

The dropdown itself and its sub-components.

Use the @requires doclet to list the subparts of a component.

MyOptionDropDown

import MyOption from 'my-library/dist/components/DropDown/MyOption.vue'
Prop nameDescriptionDefault
val

value associated with the option

string - required

-

SlotDescription
default

text displayed in the option

import filters from 'my-library/dist/components/filters/Index.vue'
SlotDescription
default
-
Default Example Usage
import FunctionalButton from 'my-library/dist/components/Functional/FunctionalButton.vue'
Prop nameDescriptionDefault
id

name attribute of the button

string

-

SlotDescription
default

name of the button

Or in a readme file

Document your functional templates in docs blocks

import Input from 'my-library/dist/components/Input/Input.vue'
Prop nameDescriptionDefault
regExp

Using for: String.prototype.replace(regexp, replacement)

RegExp

null

replacement

Using for: String.prototype.replace(regexp, replacement)

string

''

v-model
number|string

null

Event nameDescriptionProperties
input

Input event

called: numbertest called
isPacked: booleanIndicates whether the snowball is tightly packed.
change

Change event

<anonymous>: undefined
fire

Fire event

<anonymous>: string

Basic Input

import Modal from 'my-library/dist/components/Modal/Modal.vue'

Modal example modal-component.

AuthorVue
Prop nameDescriptionDefault
showModal

Show modal

boolean

false

Event nameDescription
close
SlotDescription
head

Use this slot header

body

Use this slot body

You can modify the code through the playground

The variables are reactive:

You can also develop more complex examples, instantiating Vue

import ModalHeader from 'my-library/dist/components/Modal/ModalHeader.vue'
Event nameDescription
close
SlotDescription
default
-
import Placeholder from 'my-library/dist/components/Placeholder/Placeholder.vue'

Button that counts how many times it was pressed and exposes a @public method to reset itself.

Prop nameDescriptionValuesDefault
height
number

-

150

type

type of image used as a placeholder

string

animal, bacon, beard, cat, city, food, nature, people

animal

width
number

-

150

Another example with custom blocks inside *.vue files.

import PushButton from 'my-library/dist/components/PushButton/PushButton.vue'

An example-less button.

Prop nameDescriptionValuesDefault
color
string

-

#333

size
string

small, normal, large

normal

SlotDescription
default
-
import Radio from 'my-library/dist/components/Radio/Radio.vue'
Prop nameDescriptionDefault
options
array

[]

Import it from the Readme.md file

You can have the example in remote files too.

```[import](./_radioExample.vue)
this text is going to be ignored
```

or import it from the docs block

Example can be their own file. Use the following syntax.

```[import](./_radioExample.vue)
this text is going to be ignored
```

They can be imported from anywhere from your source. To keep your code tidy and the navigation easy, keep then in the same directory as your component.

```[import](./examples/_example.js)
If you do this, vscode will not recognize the import as a link.
Prefer examples in the same folder as your comoponent.
```
import RandomButton from 'my-library/dist/components/RandomButton/RandomButton.vue'

An example-less button.

DeprecatedUse the only true button component instead
Prop nameDescriptionDefault
variants

List of possible labels.

array - required

-

You can require external files in your examples:

Another example initializing Vue

import ScopedSlot from 'my-library/dist/components/ScopedSlot/ScopedSlot.vue'
SlotDescriptionBindings
test

Menu Item footer

icon: objecticon of the menu item
text: stringtext of the menu item
First item
Second item
Third item