File tree Expand file tree Collapse file tree 3 files changed +69
-0
lines changed Expand file tree Collapse file tree 3 files changed +69
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { mergeData } from 'vue-functional-data-merge'
2
+
3
+ export const props = {
4
+ tag : {
5
+ type : String ,
6
+ default : 'div'
7
+ } ,
8
+ fluid : Boolean ,
9
+ header : String ,
10
+ lead : String ,
11
+ variant : String ,
12
+ borderVariant : String ,
13
+ textVariant : String ,
14
+ }
15
+
16
+ export default {
17
+ functional : true ,
18
+ name : 'CJumbotron' ,
19
+ props,
20
+ render ( h , { props, data, slots } ) {
21
+ let childNodes = [ ]
22
+ const $slots = slots ( )
23
+
24
+ if ( $slots . header || props . header ) {
25
+ const header = $slots . header || h ( 'h1' , { staticClass : 'display-3' } , props . header )
26
+ childNodes . push ( header )
27
+ }
28
+
29
+ if ( $slots . lead || props . lead ) {
30
+ const lead = $slots . lead || h ( 'p' , { staticClass : 'lead' } , props . lead )
31
+ childNodes . push ( lead )
32
+ }
33
+
34
+ if ( $slots . default )
35
+ childNodes . push ( $slots . default )
36
+
37
+ if ( props . fluid ) {
38
+ childNodes = [ h (
39
+ 'div' ,
40
+ { staticClass : 'container-fluid' } ,
41
+ childNodes
42
+ ) ]
43
+ }
44
+
45
+ return h (
46
+ props . tag ,
47
+ mergeData ( data , {
48
+ staticClass : 'jumbotron' ,
49
+ class : {
50
+ 'jumbotron-fluid' : props . fluid ,
51
+ [ `text-${ props . textVariant } ` ] : Boolean ( props . textVariant ) ,
52
+ [ `bg-${ props . variant } ` ] : Boolean ( props . variant ) ,
53
+ [ `border-${ props . borderVariant } ` ] : Boolean ( props . borderVariant ) ,
54
+ 'border' : Boolean ( props . borderVariant )
55
+ }
56
+ } ) ,
57
+ childNodes
58
+ )
59
+ }
60
+ }
Original file line number Diff line number Diff line change
1
+ import CJumbotron from './CJumbotron'
2
+
3
+ export {
4
+ CJumbotron
5
+ }
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export * from './ListGroup'
19
19
< << << << HEAD
20
20
<< < << << HEAD
21
21
<< < << << HEAD
22
+ << < << << HEAD
22
23
export * from './Toolip'
23
24
= === ===
24
25
export * from './Pagination'
@@ -29,3 +30,6 @@ export * from './Navbar'
29
30
=== = ===
30
31
export * from './Media'
31
32
>>> > >>> media
33
+ === = ===
34
+ export * from './Jumbotron'
35
+ >>> > >>> jumbotron
You can’t perform that action at this time.
0 commit comments