Created
March 30, 2019 07:42
-
-
Save cxmokai/3a8ff55ec23391f058581a6d63458d73 to your computer and use it in GitHub Desktop.
vue app component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div id="app" | |
| v-loading.fullscreen.lock="store.loadingRef > 0" | |
| element-loading-text="loading" | |
| element-loading-spinner="el-icon-loading" | |
| element-loading-background="rgba(0, 0, 0, 0.6)"> | |
| <router-view></router-view> | |
| </div> | |
| </template> | |
| <script> | |
| import store from '@/store'; | |
| export default { | |
| name: 'app', | |
| data() { | |
| return { | |
| store, | |
| }; | |
| }, | |
| } | |
| </script> | |
| <style lang="scss"> | |
| body { | |
| font-family: 'Avenir', Helvetica, Arial, sans-serif; | |
| -webkit-font-smoothing: antialiased; | |
| -moz-osx-font-smoothing: grayscale; | |
| margin: 0px; | |
| overflow: auto; | |
| height: 100vh; | |
| } | |
| #app { | |
| height: 100vh; | |
| } | |
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default { | |
| loadingRef: 0, | |
| addLoadingRef() { | |
| this.loadingRef += 1; | |
| }, | |
| minusLoadingRef() { | |
| if (this.loadingRef > 0) { | |
| this.loadingRef -= 1; | |
| } | |
| }, | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment