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'
1919< << << << HEAD
2020<< < << << HEAD
2121<< < << << HEAD
22+ << < << << HEAD
2223export * from './Toolip'
2324= === ===
2425export * from './Pagination'
@@ -29,3 +30,6 @@ export * from './Navbar'
2930=== = ===
3031export * from './Media'
3132>>> > >>> media
33+ === = ===
34+ export * from './Jumbotron'
35+ >>> > >>> jumbotron
You can’t perform that action at this time.
0 commit comments