SFilterItem.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. label: {
  7. required: !0,
  8. type: String
  9. },
  10. labelWidth: {
  11. type: Number,
  12. default: 70
  13. },
  14. colon: {
  15. type: Boolean,
  16. default: !1
  17. },
  18. width: {
  19. type: Number,
  20. default: 280
  21. },
  22. // 独占一行:父级 SFilterWrap 是 flex-wrap 容器,宽度拉满即整行
  23. full: {
  24. type: Boolean,
  25. default: !1
  26. },
  27. mb: {
  28. type: Number,
  29. default: 0
  30. },
  31. isNormal: {
  32. type: Boolean,
  33. default: !0
  34. }
  35. },
  36. setup(t) {
  37. const e = t, i = r(() => ({
  38. width: e.full ? "100%" : e.width + "px",
  39. marginBottom: e.mb + "px"
  40. }));
  41. return s(() => {
  42. }), (d, h) => (n(), u("div", {
  43. class: m(["filter-item", { "is-full": e.full, "is-default": t.isNormal }]),
  44. style: l(i.value)
  45. }, [
  46. a("div", {
  47. class: "label",
  48. style: l({
  49. width: e.labelWidth + "px",
  50. maxWidth: e.labelWidth + "px",
  51. minWidth: e.labelWidth + "px"
  52. })
  53. }, o(t.label) + o(e.colon ? ":" : ""), 5),
  54. a("div", c, [
  55. f(d.$slots, "default", {}, void 0, !0)
  56. ])
  57. ], 6));
  58. }
  59. }, S = /* @__PURE__ */ p(b, [["__scopeId", "data-v-8515202f"]]);
  60. export {
  61. S as default
  62. };