import { img } from "./image";
import "./index.css";
var host = "https://erphostjs.kye-erp.com/kuasheng-h5/assets/";
var map = {
  NoContent: "暂无内容",
  NoNews: "暂无消息",
  NetworkException: "网络不给力",
  OrderEmpty: "订单为空",
  HistoryEmpty: "历史记录为空",
  NoAddress: "暂无地址",
  APIFailed: "接口调用失败",
  NoResults: "无搜索结果",
  CollectionEmpty: "收藏为空"
};

var __vue_render__ = function __vue_render__() {
  var _vm = this;

  var _h = _vm.$createElement;

  var _c = _vm._self._c || _h;

  return _c('div', {
    staticClass: "ks-no-data-wrapper"
  }, [_c('img', {
    directives: [{
      name: "show",
      rawName: "v-show",
      value: !_vm.base64Url,
      expression: "!base64Url"
    }],
    attrs: {
      "src": _vm.imageUrl,
      "width": _vm.size + "px",
      "height": _vm.size + "px"
    },
    on: {
      "error": _vm.onError,
      "load": function load($event) {
        _vm.base64Url = null;
      }
    }
  }), _vm._v(" "), _c('img', {
    directives: [{
      name: "show",
      rawName: "v-show",
      value: _vm.base64Url,
      expression: "base64Url"
    }],
    attrs: {
      "src": _vm.base64Url,
      "width": _vm.size + "px",
      "height": _vm.size + "px"
    }
  }), _vm._v(" "), _c('p', {
    directives: [{
      name: "show",
      rawName: "v-show",
      value: !_vm.base64Url,
      expression: "!base64Url"
    }]
  }, [_vm._v(_vm._s(_vm._text))]), _vm._v(" "), _c('p', {
    directives: [{
      name: "show",
      rawName: "v-show",
      value: _vm.base64Url,
      expression: "base64Url"
    }]
  }, [_vm._v("网络不给力")])]);
};

var __vue_staticRenderFns__ = [];
export default {
  render: __vue_render__,
  staticRenderFns: __vue_staticRenderFns__,
  name: "ks-no-data",
  props: {
    type: {
      type: String,
      default: "NoContent"
    },
    size: {
      type: Number,
      default: 140
    },
    text: String
  },
  data: function data() {
    return {
      base64Url: null
    };
  },
  computed: {
    imageUrl: function imageUrl() {
      return map[this.type] ? "" + host + this.type + ".png" : "";
    },
    _text: function _text() {
      return this.text != undefined ? this.text : map[this.type] ? map[this.type] : "暂无内容";
    }
  },
  methods: {
    onError: function onError() {
      this.base64Url = img;
    }
  }
};