Skip to content

Commit d714b46

Browse files
sancheng163rstoenescu
authored andcommitted
custom configuration of Loading (quasarframework#1015)
The customClass field is added to the configuration of the Loading to facilitate the developer customization style
1 parent a97df10 commit d714b46

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/components/loading/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,19 @@ function show ({
2020
spinnerSize = 80,
2121
spinnerColor = 'white',
2222
messageColor = 'white',
23-
spinner = QSpinner
23+
spinner = QSpinner,
24+
customClass = false
2425
} = {}) {
2526
props.spinner = spinner
2627
props.message = message
2728
props.spinnerSize = spinnerSize
2829
props.spinnerColor = spinnerColor
2930
props.messageColor = messageColor
3031

32+
if (customClass && typeof customClass === 'string') {
33+
props.customClass = ` ${customClass.trim()}`
34+
}
35+
3136
if (appIsInProgress) {
3237
vm && vm.$forceUpdate()
3338
return
@@ -61,7 +66,7 @@ function show ({
6166
}))
6267
}
6368

64-
return h('div', {staticClass}, child)
69+
return h('div', {staticClass: staticClass + props.customClass}, child)
6570
}
6671
})
6772
}, delay)

0 commit comments

Comments
 (0)