空状态/loading - 占位

488 阅读1分钟

文档与演示

image.png

插件地址-jeft-vue

use

import RequestState from 'jeft-vue/components/request-state'
复制代码

props

参数类型默认值描述
imagestring''empty / loading / search / 自定义传入图片src
textstringempty - '没有数据' ,loading - '加载中...'''
bottomTopNumber10底部占位大小(px)
colorColor背景颜色transparent
textColorColorempty - '#d0d5e0' ,loading - '#444'文字颜色

demo

    <j-request-state :image="state">
        <template v-slot:image v-if="state == 'loading'">
          <j-loading size="100%"></j-loading>
        </template>
        <template v-slot:text v-if="state == 'loading'">
          <span></span>
        </template>
      </j-request-state>
    <j-request-state image="loading"></j-request-state>
  data() {
    return {
      state: "loading",
    };
  },
  mounted() {
    setTimeout(() => {
      this.state = "";
    }, 1800);
  },