Loading: support change spinner and background Closes #21660 Closes #13344

(cherry picked from commit 64d37e0175)
pull/22576/head
tianchao 2023-06-25 15:29:45 +08:00
parent f14b5ba540
commit 04a3d934da
2 changed files with 8 additions and 0 deletions

View File

@ -113,6 +113,8 @@ loadingDirective.install = Vue => {
update: function(el, binding) { update: function(el, binding) {
el.instance.setText(el.getAttribute('element-loading-text')); el.instance.setText(el.getAttribute('element-loading-text'));
el.instance.setSpinner(el.getAttribute('element-loading-spinner'));
el.instance.setBackground(el.getAttribute('element-loading-background'));
if (binding.oldValue !== binding.value) { if (binding.oldValue !== binding.value) {
toggleLoading(el, binding); toggleLoading(el, binding);
} }

View File

@ -35,6 +35,12 @@
}, },
setText(text) { setText(text) {
this.text = text; this.text = text;
},
setSpinner(spinner) {
this.spinner = spinner;
},
setBackground(background) {
this.background = background;
} }
} }
}; };