Commit 7e22e0a38bec094fffffae0db36a35a0c1b6512b
1 parent
1214e8b7
loading
Showing
3 changed files
with
57 additions
and
6 deletions
src/components/loading.vue
0 → 100644
| 1 | +<!-- | |
| 2 | + * | |
| 3 | + * loadingGif组件--"数据请求中" | |
| 4 | + * | |
| 5 | + * 使用方法: | |
| 6 | + * <loading-gif :show-loading="showLoaddingGif"></loading-gif> | |
| 7 | + * | |
| 8 | + * 通过修改showLoaddingGif的true或者false 来控制loading的显示和隐藏! | |
| 9 | + * | |
| 10 | + --> | |
| 11 | +<template> | |
| 12 | + <div class='loading-wrap' v-show="showLoading"> | |
| 13 | + 加载中。。。。。。 | |
| 14 | + </div> | |
| 15 | +</template> | |
| 16 | + | |
| 17 | + | |
| 18 | +<script> | |
| 19 | +export default { | |
| 20 | + props: ["showLoading"], | |
| 21 | + name: 'loading' | |
| 22 | +} | |
| 23 | +</script> | |
| 24 | + | |
| 25 | + | |
| 26 | +<style scoped> | |
| 27 | +.loading-wrap{ | |
| 28 | + position: fixed; | |
| 29 | + top:0; | |
| 30 | + left: 0; | |
| 31 | + width: 100%; | |
| 32 | + height: 100%; | |
| 33 | + background: #ccc; | |
| 34 | +} | |
| 35 | +</style> | |
| 36 | + | |
| 37 | + | ... | ... |
src/store/store.js
0 → 100644
No preview for this file type
src/views/mainContainer.vue
| ... | ... | @@ -16,12 +16,21 @@ |
| 16 | 16 | <div class="heightsmall"></div> |
| 17 | 17 | </li> |
| 18 | 18 | </ul> |
| 19 | + <loadinggif :showLoading="showLoaddingGif"></loadinggif> | |
| 19 | 20 | </div> |
| 20 | 21 | </template> |
| 21 | 22 | |
| 22 | 23 | <script> |
| 24 | +import loadinggif from '../components/loading' | |
| 25 | + | |
| 23 | 26 | export default { |
| 24 | - name: 'mainContainer' | |
| 27 | + name: 'mainContainer', | |
| 28 | + components: {loadinggif}, | |
| 29 | + data() { | |
| 30 | + return { | |
| 31 | + showLoaddingGif: false | |
| 32 | + } | |
| 33 | + } | |
| 25 | 34 | } |
| 26 | 35 | </script> |
| 27 | 36 | |
| ... | ... | @@ -30,7 +39,8 @@ export default { |
| 30 | 39 | padding: 12px 12px; |
| 31 | 40 | flex: 1; |
| 32 | 41 | } |
| 33 | - .containerwrap{ | |
| 42 | + | |
| 43 | + .containerwrap { | |
| 34 | 44 | display: flex; |
| 35 | 45 | height: 100%; |
| 36 | 46 | } |
| ... | ... | @@ -44,7 +54,8 @@ export default { |
| 44 | 54 | .containerwrap > li:nth-of-type(1) { |
| 45 | 55 | flex: 1; |
| 46 | 56 | } |
| 47 | - .heightsmall{ | |
| 57 | + | |
| 58 | + .heightsmall { | |
| 48 | 59 | flex: 1; |
| 49 | 60 | background: #f00; |
| 50 | 61 | } |
| ... | ... | @@ -52,12 +63,14 @@ export default { |
| 52 | 63 | .containerwrap > li:nth-of-type(2) { |
| 53 | 64 | flex: 2; |
| 54 | 65 | } |
| 55 | - .heightper-top{ | |
| 66 | + | |
| 67 | + .heightper-top { | |
| 56 | 68 | background: #f00; |
| 57 | 69 | flex: 1; |
| 58 | 70 | } |
| 59 | - .heightper-bottom{ | |
| 60 | - height: calc((100% - 24px)/3) ; | |
| 71 | + | |
| 72 | + .heightper-bottom { | |
| 73 | + height: calc((100% - 24px) / 3); | |
| 61 | 74 | background: #f00; |
| 62 | 75 | margin-top: 12px; |
| 63 | 76 | } | ... | ... |