File tree Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ import { mergeData } from 'vue-functional-data-merge'
2+ export default {
3+ name : 'CSpinner' ,
4+ functional : true ,
5+ props : {
6+ grow : Boolean ,
7+ variant : String ,
8+ small : Boolean ,
9+ tag : {
10+ type : String ,
11+ default : 'span'
12+ } ,
13+ labelText : {
14+ type : String ,
15+ default : 'Loading...'
16+ } ,
17+ noLabel : Boolean
18+ } ,
19+ render ( h , { props, data, slots } ) {
20+ let label = h ( false )
21+ if ( ! props . noLabel )
22+ label = h ( 'span' , { staticClass : 'sr-only' } , props . labelText )
23+ const type = props . grow ? 'grow' : 'border'
24+ return h (
25+ props . tag ,
26+ mergeData ( data , {
27+ attrs : {
28+ role : 'status' ,
29+ 'aria-hidden' : label ? null : 'true'
30+ } ,
31+ class : [ `spinner-${ type } ` ,
32+ {
33+ [ `spinner-${ type } -sm` ] : props . small ,
34+ [ `text-${ props . variant } ` ] : Boolean ( props . variant )
35+ }
36+ ]
37+ } ) ,
38+ [ label ]
39+ )
40+ }
41+ }
Original file line number Diff line number Diff line change 1+ import CSpinner from './CSpinner'
2+
3+ export {
4+ CSpinner
5+ }
Original file line number Diff line number Diff line change @@ -22,3 +22,4 @@ export * from './Table'
2222export * from './Form'
2323export * from './Collapse'
2424export * from './Modal'
25+ export * from './Spinner'
You can’t perform that action at this time.
0 commit comments