Skip to content

Commit ecc7622

Browse files
committed
1.5.0 release
1 parent d60ae96 commit ecc7622

File tree

2 files changed

+44
-17
lines changed

2 files changed

+44
-17
lines changed

README.md

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,66 @@
11
# vue-simple-tabs
2+
23
Tabs component for vue.js
34

4-
## Installation:
5+
## Installation
56

67
NPM:
8+
79
```bash
810
npm install --save vue-simple-tabs
911
```
12+
1013
Yarn:
14+
1115
```bash
1216
yarn add vue-simple-tabs
1317
```
1418

15-
## Usage:
19+
## Usage
1620

1721
```html
1822
<template>
1923
<tabs>
20-
<tab title="Tab 1" active="true">
21-
Tab 1 content
22-
</tab>
23-
<tab title="Tab 2">
24-
Tab 2 content
25-
</tab>
26-
<tab title="Tab 3">
27-
Tab 3 content
28-
</tab>
24+
<tab title="Tab 1" active="true">Tab 1 content</tab>
25+
<tab title="Tab 2">Tab 2 content</tab>
26+
<tab title="Tab 3">Tab 3 content</tab>
27+
</tabs>
28+
</template>
29+
30+
<script>
31+
import { Tabs, Tab } from 'vue-simple-tabs';
32+
33+
export default {
34+
components: { Tabs, Tab }
35+
};
36+
</script>
37+
```
38+
39+
## Events
40+
41+
You can add a handler for tab changed event.
42+
43+
Example:
44+
45+
```html
46+
<template>
47+
<tabs @changed="tabChanged">
48+
<tab title="Tab 1" active="true">Tab 1</tab>
49+
<tab title="Tab 2">Tab 2</tab>
50+
<tab title="Tab 3">Tab 3</tab>
2951
</tabs>
3052
</template>
3153

3254
<script>
33-
import { Tabs, Tab } from 'vue-simple-tabs';
55+
import { Tabs, Tab } from 'vue-simple-tabs';
3456
35-
export default {
36-
components: { Tabs, Tab }
37-
}
57+
export default {
58+
components: { Tabs, Tab },
59+
methods: {
60+
tabChanged(tab) {
61+
// Do something
62+
}
63+
}
64+
};
3865
</script>
39-
```
66+
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-simple-tabs",
3-
"version": "1.4.2",
3+
"version": "1.5.0",
44
"description": "Tabs component for vue.js",
55
"main": "src/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)