File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 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 ;
Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments