File tree 2 files changed +44
-17
lines changed
2 files changed +44
-17
lines changed Original file line number Diff line number Diff line change 1
1
# vue-simple-tabs
2
+
2
3
Tabs component for vue.js
3
4
4
- ## Installation:
5
+ ## Installation
5
6
6
7
NPM:
8
+
7
9
``` bash
8
10
npm install --save vue-simple-tabs
9
11
```
12
+
10
13
Yarn:
14
+
11
15
``` bash
12
16
yarn add vue-simple-tabs
13
17
```
14
18
15
- ## Usage:
19
+ ## Usage
16
20
17
21
``` html
18
22
<template >
19
23
<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 >
29
51
</tabs >
30
52
</template >
31
53
32
54
<script >
33
- import { Tabs , Tab } from ' vue-simple-tabs' ;
55
+ import { Tabs , Tab } from ' vue-simple-tabs' ;
34
56
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
+ };
38
65
</script >
39
- ```
66
+ ```
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue-simple-tabs" ,
3
- "version" : " 1.4.2 " ,
3
+ "version" : " 1.5.0 " ,
4
4
"description" : " Tabs component for vue.js" ,
5
5
"main" : " src/index.js" ,
6
6
"scripts" : {
You can’t perform that action at this time.
0 commit comments