fixed #1063
This commit is contained in:
parent
300bd6623e
commit
297648f1e6
9 changed files with 180 additions and 33 deletions
55
src/components/spin/spin.js
Normal file
55
src/components/spin/spin.js
Normal file
|
@ -0,0 +1,55 @@
|
|||
import Vue from 'vue';
|
||||
import Spin from './spin.vue';
|
||||
|
||||
Spin.newInstance = properties => {
|
||||
const _props = properties || {};
|
||||
|
||||
const Instance = new Vue({
|
||||
data: Object.assign({}, _props, {
|
||||
|
||||
}),
|
||||
render (h) {
|
||||
let vnode = '';
|
||||
if (this.render) {
|
||||
vnode = h(Spin, {
|
||||
props: {
|
||||
fix: true,
|
||||
fullscreen: true
|
||||
}
|
||||
}, [this.render(h)]);
|
||||
} else {
|
||||
vnode = h(Spin, {
|
||||
props: {
|
||||
size: 'large',
|
||||
fix: true,
|
||||
fullscreen: true
|
||||
}
|
||||
});
|
||||
}
|
||||
return h('div', {
|
||||
'class': 'ivu-spin-fullscreen'
|
||||
}, [vnode]);
|
||||
}
|
||||
});
|
||||
|
||||
const component = Instance.$mount();
|
||||
document.body.appendChild(component.$el);
|
||||
const spin = Instance.$children[0];
|
||||
|
||||
return {
|
||||
show () {
|
||||
spin.visible = true;
|
||||
},
|
||||
remove (cb) {
|
||||
spin.visible = false;
|
||||
setTimeout(function() {
|
||||
spin.$parent.$destroy();
|
||||
document.body.removeChild(document.getElementsByClassName('ivu-spin-fullscreen')[0]);
|
||||
cb();
|
||||
}, 500);
|
||||
},
|
||||
component: spin
|
||||
};
|
||||
};
|
||||
|
||||
export default Spin;
|
Loading…
Add table
Add a link
Reference in a new issue