SFilterItem.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import { computed as r, onMounted as s, openBlock as n, createElementBlock as u, normalizeStyle as l, normalizeClass as m, createElementVNode as a, toDisplayString as o, renderSlot as f } from "vue";
  2. import { n as p } from "./index2.js";
  3. const c = { class: "value" }, b = {
  4. __name: "SFilterItem",
  5. props: {
  6. // 标签文案(必填)
  7. label: {
  8. required: !0,
  9. type: String
  10. },
  11. // 标签宽度,单位 px
  12. labelWidth: {
  13. type: Number,
  14. default: 70
  15. },
  16. // 标签后是否带冒号
  17. colon: {
  18. type: Boolean,
  19. default: !1
  20. },
  21. // 表单项宽度,单位 px(full 为 true 时失效)
  22. width: {
  23. type: Number,
  24. default: 280
  25. },
  26. // 独占一行:父级 SFilterWrap 是 flex-wrap 容器,宽度拉满即整行
  27. full: {
  28. type: Boolean,
  29. default: !1
  30. },
  31. // 底部外边距,单位 px
  32. mb: {
  33. type: Number,
  34. default: 0
  35. },
  36. // 默认描边样式;false 为无边框样式
  37. isNormal: {
  38. type: Boolean,
  39. default: !0
  40. }
  41. },
  42. setup(t) {
  43. const e = t, i = r(() => ({
  44. width: e.full ? "100%" : e.width + "px",
  45. marginBottom: e.mb + "px"
  46. }));
  47. return s(() => {
  48. }), (d, h) => (n(), u("div", {
  49. class: m(["filter-item", { "is-full": e.full, "is-default": t.isNormal }]),
  50. style: l(i.value)
  51. }, [
  52. a("div", {
  53. class: "label",
  54. style: l({
  55. width: e.labelWidth + "px",
  56. maxWidth: e.labelWidth + "px",
  57. minWidth: e.labelWidth + "px"
  58. })
  59. }, o(t.label) + o(e.colon ? ":" : ""), 5),
  60. a("div", c, [
  61. f(d.$slots, "default", {}, void 0, !0)
  62. ])
  63. ], 6));
  64. }
  65. }, S = /* @__PURE__ */ p(b, [["__scopeId", "data-v-8d8fd6ae"]]);
  66. export {
  67. S as default
  68. };