SFilterItem.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import { computed as d, onMounted as i, openBlock as n, createElementBlock as u, normalizeStyle as l, normalizeClass as m, createElementVNode as o, toDisplayString as a, renderSlot as c } from "vue";
  2. import { n as p } from "./index2.js";
  3. const f = { 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. },
  32. setup(t) {
  33. const e = t, r = d(() => ({
  34. width: e.full ? "100%" : e.width + "px",
  35. marginBottom: e.mb + "px"
  36. }));
  37. return i(() => {
  38. }), (s, y) => (n(), u("div", {
  39. class: m(["filter-item", { "is-full": e.full }]),
  40. style: l(r.value)
  41. }, [
  42. o("div", {
  43. class: "label",
  44. style: l({ width: e.labelWidth + "px" })
  45. }, a(t.label) + a(e.colon ? ":" : ""), 5),
  46. o("div", f, [
  47. c(s.$slots, "default", {}, void 0, !0)
  48. ])
  49. ], 6));
  50. }
  51. }, S = /* @__PURE__ */ p(b, [["__scopeId", "data-v-1386d4b5"]]);
  52. export {
  53. S as default
  54. };