Skip to content

Commit 336a978

Browse files
committed
update code.
1 parent d91d0a3 commit 336a978

File tree

2 files changed

+30
-17
lines changed

2 files changed

+30
-17
lines changed

index.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
1-
import indexVue from './index.vue';
1+
import indexVue from './index'
22

33
function plugin( Vue, options ){
4-
5-
var myPluginVue = Vue.extend( indexVue );
4+
var myPluginVue = Vue.extend( indexVue )
65
var vm = new myPluginVue({
76
data: {
87
isLoading: false
98
}
10-
}).$mount();
11-
// document.getElementById( 'app' ).appendChild( vm.$el );
12-
document.body.appendChild(vm.$el);
13-
9+
}).$mount()
10+
document.body.appendChild(vm.$el)
1411
Vue.prototype.$isLoading = function( isLoading ){
15-
vm.changeStatus( isLoading );
12+
vm.changeStatus( isLoading )
1613
}
17-
18-
// Vue.prototype.$isLoading = function(){
19-
// vm.changeStatus( isLoading );
20-
// }
2114
}
2215

23-
export default plugin;
16+
export default plugin

index.vue

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,35 @@
77

88
<script>
99
export default {
10-
data : function(){
10+
data () {
1111
return {
1212
isLoading: false
1313
}
1414
},
1515
methods : {
16-
changeStatus: function( isLoading ){
17-
this.isLoading = isLoading;
16+
changeStatus ( isLoading ){
17+
this.isLoading = isLoading
1818
}
1919
}
2020
}
21-
</script>
21+
</script>
22+
23+
<style scoped>
24+
.loading{
25+
position: fixed;
26+
left: 0;
27+
top: 0;
28+
right: 0;
29+
bottom: 0;
30+
height: 100%;
31+
z-index: 99999 !important;
32+
width: 100%;
33+
background-color: rgba(0, 0, 0, 0.6);
34+
}
35+
.loading i {
36+
position: absolute;
37+
opacity: 1;
38+
left: 48vw;
39+
top: 48vh;
40+
}
41+
</style>

0 commit comments

Comments
 (0)