Skip to content

Commit d91d0a3

Browse files
committed
first commit
0 parents  commit d91d0a3

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

index.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import indexVue from './index.vue';
2+
3+
function plugin( Vue, options ){
4+
5+
var myPluginVue = Vue.extend( indexVue );
6+
var vm = new myPluginVue({
7+
data: {
8+
isLoading: false
9+
}
10+
}).$mount();
11+
// document.getElementById( 'app' ).appendChild( vm.$el );
12+
document.body.appendChild(vm.$el);
13+
14+
Vue.prototype.$isLoading = function( isLoading ){
15+
vm.changeStatus( isLoading );
16+
}
17+
18+
// Vue.prototype.$isLoading = function(){
19+
// vm.changeStatus( isLoading );
20+
// }
21+
}
22+
23+
export default plugin;

index.vue

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<template>
2+
<div class="loading" v-show="isLoading">
3+
<i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i>
4+
<span class="sr-only">Loading...</span>
5+
</div>
6+
</template>
7+
8+
<script>
9+
export default {
10+
data : function(){
11+
return {
12+
isLoading: false
13+
}
14+
},
15+
methods : {
16+
changeStatus: function( isLoading ){
17+
this.isLoading = isLoading;
18+
}
19+
}
20+
}
21+
</script>

0 commit comments

Comments
 (0)