当前位置:   article > 正文

Vue + elementUi:v-loading使用_v-loading="tableloading

v-loading="tableloading

记录一下v-loading="tableloading"使用
在table数据渲染时使用,HTML中添加:

v-loading=“tableloading”

<el-table
          ref="dynamictable"
          :data="form.coldata"
          v-loading="tableloading"
          tooltip-effect="dark"
          style="width: 100%"
          max-height="250"
          @select="handleSelectionChange"
          @select-all="selectAll"
        >
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

data中定义:

tableloading: false

在调用接口加载table数据时:
methods方法中:

initData () {
      this.tableloading = true;
        request({
          url: "/",
          method: "get",
          params: ''
        }).then(resp => {
          if (resp.success) {
            console.log(resp)
          } else {
            this.tableloading = false;
            this.$message({ type: "error", message: resp.message });
          }
        });
      }
    },
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/496003
推荐阅读
相关标签
  

闽ICP备14008679号