u-empty.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. "use strict";
  2. const common_vendor = require("../../../../common/vendor.js");
  3. const _sfc_main = {
  4. name: "u-empty",
  5. mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$7],
  6. data() {
  7. return {
  8. icons: {
  9. car: "购物车为空",
  10. page: "页面不存在",
  11. search: "没有搜索结果",
  12. address: "没有收货地址",
  13. wifi: "没有WiFi",
  14. order: "订单为空",
  15. coupon: "没有优惠券",
  16. favor: "暂无收藏",
  17. permission: "无权限",
  18. history: "无历史记录",
  19. news: "无新闻列表",
  20. message: "消息列表为空",
  21. list: "列表为空",
  22. data: "数据为空",
  23. comment: "暂无评论"
  24. }
  25. };
  26. },
  27. computed: {
  28. // 组件样式
  29. emptyStyle() {
  30. const style = {};
  31. style.marginTop = common_vendor.index.$u.addUnit(this.marginTop);
  32. return common_vendor.index.$u.deepMerge(common_vendor.index.$u.addStyle(this.customStyle), style);
  33. },
  34. // 文本样式
  35. textStyle() {
  36. const style = {};
  37. style.color = this.textColor;
  38. style.fontSize = common_vendor.index.$u.addUnit(this.textSize);
  39. return style;
  40. },
  41. // 判断icon是否图片路径
  42. isSrc() {
  43. return this.icon.indexOf("/") >= 0;
  44. }
  45. }
  46. };
  47. if (!Array) {
  48. const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
  49. _easycom_u_icon2();
  50. }
  51. const _easycom_u_icon = () => "../u-icon/u-icon.js";
  52. if (!Math) {
  53. _easycom_u_icon();
  54. }
  55. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  56. return common_vendor.e({
  57. a: _ctx.show
  58. }, _ctx.show ? common_vendor.e({
  59. b: !$options.isSrc
  60. }, !$options.isSrc ? {
  61. c: common_vendor.p({
  62. name: _ctx.mode === "message" ? "chat" : `empty-${_ctx.mode}`,
  63. size: _ctx.iconSize,
  64. color: _ctx.iconColor,
  65. ["margin-top"]: "14"
  66. })
  67. } : {
  68. d: _ctx.$u.addUnit(_ctx.width),
  69. e: _ctx.$u.addUnit(_ctx.height),
  70. f: _ctx.icon
  71. }, {
  72. g: common_vendor.t(_ctx.text ? _ctx.text : $data.icons[_ctx.mode]),
  73. h: common_vendor.s($options.textStyle),
  74. i: _ctx.$slots.default || _ctx.$slots.$default
  75. }, _ctx.$slots.default || _ctx.$slots.$default ? {} : {}, {
  76. j: common_vendor.s($options.emptyStyle)
  77. }) : {});
  78. }
  79. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-bd84101d"], ["__file", "F:/兴元/开门柜项目/平台端管理系统小程序/node_modules/uview-plus/components/u-empty/u-empty.vue"]]);
  80. wx.createComponent(Component);