# loading

网络加载请求的loading框,会填满整个父容器的高宽,如果它的父容器是body,那loading效果就是全屏

# 效果

点我查看效果

# 位置

文件目录:resources/src/globalWidget/loading.vue

# 使用示例

<loading v-show="isLoading"></loading>
1
import loading from '跟进相对路径引入'

export default {
    components {
        loading
    },
    created() {
        this.isLoading = true
        this.$http.get('/demo').then((res) => {
            this.isLoading = false
            if (res.code === 0) {

            } else {
                toast(res.msg || '网络异常,请稍后再试')
            }
        }).catch((err) => {
            this.isLoading = false
            toast('网络异常,请稍后再试')
        })
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21