zoukankan      html  css  js  c++  java
  • Element-UI 中 loading 的使用

    表格加载
     <el-table
                    :data="tableData"
                    row-key="target_id"
                    v-loading="loading"
                    element-loading-text="小主别急"
                    border
                >
    async getAllIndicatorNameList() {
                this.loading = true
                const result = await getAllIndicatorNameList(this.user_id,this.type,this.inputValue);
                this.tableData = [];
                let tempData = [];
                if (result) {
                    this.loading = false;  
                    if (result.MSGCODE == '007') {
                        tempData = result.RESULT;
                        tempData.map((item,index,array)=>{
                            this.tableData.push({"type_name":this.typeName,"target_id":item.TARGET_INST_ID, "target_name":item.TARGET_INST_NAME, "status":item.STATUS,"target_donc":item.TARGET_INST_DONC});
                        });
                    }
                } else {
                Toast('服务器异常')
                this.loading = false;
               } 
            }
    全屏加载
    async updateIndicatorNameList() {
                const loading = this.$loading({
                    lock: true,//lock的修改符--默认是false
                    text: '小主别急',//显示在加载图标下方的加载文案
                    // background: 'rgba(0, 0, 0, 0.7)',//遮罩层颜色
                    target: document.body//loadin覆盖的dom元素节点
                });
                const result = await updateIndicatorNameList(this.user_id,this.type,this.submitData);
                if (result) {
                    //成功回调函数停止加载
                    loading.close()
                    if (result.MSGCODE == '007') {
                        // Toast('操作成功');
                        this.$router.push({path:"/localIndicators"});
                    }
                } else {
                Toast('服务器异常')
                loading.close()
               } 
            }
  • 相关阅读:
    Hdu-5983 2016ACM/ICPC亚洲区青岛站 B.Pocket Cube 模拟
    Codeforces Round #300 F
    cf298F:状压dp+剪枝
    POJ3294--Life Forms 后缀数组+二分答案 大于k个字符串的最长公共子串
    jzp线性筛及其简单应用
    Codeforces Round #299 (Div. 1)C. Tavas and Pashmaks (凸壳)
    Codeforces Round #236 (Div. 2)E. Strictly Positive Matrix(402E)
    【2012天津区域赛】部分题解 hdu4431—4441
    HDU4436---str2int 后缀树组(12年天津区域赛)
    Codeforces
  • 原文地址:https://www.cnblogs.com/snowhite/p/15066775.html
Copyright © 2011-2022 走看看