su-subline.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const _sfc_main = {
  4. __name: "su-subline",
  5. props: {
  6. // 线条颜色
  7. lineColor: {
  8. type: String,
  9. default: "#000"
  10. },
  11. // 线条样式:'dotted', 'solid', 'double', 'dashed'
  12. borderType: {
  13. type: String,
  14. default: "dashed"
  15. },
  16. // 线条宽度
  17. lineWidth: {
  18. type: Number,
  19. default: 1
  20. },
  21. // 高度
  22. height: {
  23. type: [Number, String],
  24. default: "auto"
  25. },
  26. // 左右边距:none - 无边距,horizontal - 左右留边
  27. paddingType: {
  28. type: String,
  29. default: "none"
  30. }
  31. },
  32. setup(__props) {
  33. const props = __props;
  34. const elStyle = common_vendor.computed(() => {
  35. return {
  36. "border-top-width": `${props.lineWidth}px`,
  37. "border-top-color": props.lineColor,
  38. "border-top-style": props.borderType,
  39. margin: props.paddingType === "none" ? "0" : "0px 16px"
  40. };
  41. });
  42. return (_ctx, _cache) => {
  43. return {
  44. a: common_vendor.s(elStyle.value),
  45. b: `${__props.height}px`
  46. };
  47. };
  48. }
  49. };
  50. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b2944841"], ["__file", "D:/zx/mall-front-app/sheep/ui/su-subline/su-subline.vue"]]);
  51. wx.createComponent(Component);