u-row.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. "use strict";
  2. const common_vendor = require("../../../../common/vendor.js");
  3. const _sfc_main = {
  4. name: "u-row",
  5. mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$18],
  6. data() {
  7. return {};
  8. },
  9. computed: {
  10. uJustify() {
  11. if (this.justify == "end" || this.justify == "start")
  12. return "flex-" + this.justify;
  13. else if (this.justify == "around" || this.justify == "between")
  14. return "space-" + this.justify;
  15. else
  16. return this.justify;
  17. },
  18. uAlignItem() {
  19. if (this.align == "top")
  20. return "flex-start";
  21. if (this.align == "bottom")
  22. return "flex-end";
  23. else
  24. return this.align;
  25. },
  26. rowStyle() {
  27. const style = {
  28. alignItems: this.uAlignItem,
  29. justifyContent: this.uJustify
  30. };
  31. if (this.gutter) {
  32. style.marginLeft = common_vendor.addUnit(-Number(this.gutter) / 2);
  33. style.marginRight = common_vendor.addUnit(-Number(this.gutter) / 2);
  34. }
  35. return common_vendor.deepMerge(style, common_vendor.addStyle(this.customStyle));
  36. }
  37. },
  38. emits: ["click"],
  39. methods: {
  40. clickHandler(e) {
  41. this.$emit("click");
  42. },
  43. async getComponentWidth() {
  44. await common_vendor.sleep();
  45. return new Promise((resolve) => {
  46. this.$uGetRect(".u-row").then((res) => {
  47. resolve(res.width);
  48. });
  49. });
  50. }
  51. }
  52. };
  53. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  54. return {
  55. a: common_vendor.s($options.rowStyle),
  56. b: common_vendor.o((...args) => $options.clickHandler && $options.clickHandler(...args))
  57. };
  58. }
  59. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-f8e42af4"], ["__file", "C:/Users/Administrator/Desktop/srcaaa/node_modules/uview-plus/components/u-row/u-row.vue"]]);
  60. wx.createComponent(Component);