t-th.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const _sfc_main = {
  4. props: {
  5. align: String
  6. },
  7. data() {
  8. return {
  9. thBorder: "1",
  10. borderColor: "#d0dee5",
  11. fontSize: "15",
  12. color: "#3b4246",
  13. thAlign: "center"
  14. };
  15. },
  16. inject: ["table", "tr"],
  17. created() {
  18. this.thBorder = this.table.border;
  19. this.borderColor = this.table.borderColor;
  20. this.fontSize = this.tr.fontSize;
  21. this.color = this.tr.color;
  22. if (this.align) {
  23. this.thAlign = this.align;
  24. } else {
  25. this.thAlign = this.tr.align;
  26. }
  27. },
  28. computed: {
  29. thAlignCpd() {
  30. let nameAlign = "";
  31. switch (this.thAlign) {
  32. case "left":
  33. nameAlign = "flex-start";
  34. break;
  35. case "center":
  36. nameAlign = "center";
  37. break;
  38. case "right":
  39. nameAlign = "flex-end";
  40. break;
  41. default:
  42. nameAlign = "center";
  43. break;
  44. }
  45. return nameAlign;
  46. }
  47. }
  48. };
  49. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  50. return {
  51. a: $data.thBorder + "px",
  52. b: $data.borderColor,
  53. c: $data.fontSize + "px",
  54. d: $data.color,
  55. e: $options.thAlignCpd
  56. };
  57. }
  58. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "E:/psy_web_share/components/t-table/t-th.vue"]]);
  59. tt.createComponent(Component);