Skip to content

Commit

Permalink
docs: detailed props and events
Browse files Browse the repository at this point in the history
  • Loading branch information
Leecason committed May 29, 2020
1 parent 1e7162d commit 4c0eb36
Showing 1 changed file with 91 additions and 3 deletions.
94 changes: 91 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,32 +41,120 @@ template:
:is-show="isShow"
type="underline"
>
<span>This is a text</span>
<span>Rough Notation is awesome</span>
</RoughNotation>
```

## Props

Check [configuring-the-annotation](https://github.com/pshihn/rough-notation#configuring-the-annotation)
### type

**and**
**Type**: `string`

**required**: `true`

This is a mandatory field. It sets the annotation style. Following are the list of supported annotation types:

- **underline**: Create a sketchy underline below an element.
- **box**: This style draws a box around the element.
- **circle**: Draw a circle around the element.
- **highlight**: Creates a highlight effect as if maked by a highlighter.
- **strike-through**: This style draws a box around the element.
- **crossed-off**: This style draws a box around the element.

### isShow

**Type**: `boolean`

**Required**: `false`

**Default**: `false`

Whether draws the annotation.

### animate

**Type**: `boolean`

**Required**: `false`

**Default**: `true`

Turn on/off animation when annotating.

### animationDuration

**Type**: `number`

**Required**: `false`

**Default**: `800`

Duration of the animation in milliseconds.

### animationDelay

**Type**: `number`

**Required**: `false`

**Default**: `0`

Delay in animation in milliseconds.

### color

**Type**: `string`

**Required**: `false`

**Default**: `currentColor`

Representing the color of the annotation sketch.

### strokeWidth

**Type**: `number`

**Required**: `false`

**Default**: `1`

Width of the annotation strokes.

### padding

**Type**: `number`

**Required**: `false`

**Default**: `5`(in pixels)

Padding between the element and roughly where the annotation is drawn.

### tag

**Type**: `string`

**Required**: `false`

**Default**: `'div'`

String HTML tag name (default: `div`); if falsy (for example `null` or `undefined`), the component will be renderless (the content won't be wrapped in a tag), in this case, only the first child will be rendered

## Events

### init

**Parameters**: [`Annotation Object`](https://github.com/pshihn/rough-notation#annotation-object)

Called when the component is initialized.

## TODO

- [ ] Annotation Group
- [ ] Demo pages

## License

[MIT](https://github.com/Leecason/vue-rough-notation/blob/master/LICENSE)

0 comments on commit 4c0eb36

Please sign in to comment.