t-tr.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const _sfc_main = {
  4. props: {
  5. fontSize: String,
  6. color: String,
  7. align: String
  8. },
  9. inject: ["table"],
  10. provide() {
  11. return {
  12. tr: this
  13. };
  14. },
  15. data() {
  16. return {
  17. isCheck: false,
  18. checkboxData: {
  19. value: 0,
  20. checked: false
  21. },
  22. checked: false,
  23. thBorder: "1",
  24. borderColor: "#d0dee5"
  25. };
  26. },
  27. created() {
  28. this.thBorder = this.table.border;
  29. this.borderColor = this.table.borderColor;
  30. this.table.childrens.push(this);
  31. this.checkboxData.value = this.table.index++;
  32. this.isCheck = this.table.isCheck;
  33. },
  34. methods: {
  35. checkboxChange(e) {
  36. this.checkboxData.checked = !this.checkboxData.checked;
  37. this.table.childrens[this.checkboxData.value] = this;
  38. this.table.fire(e.detail.value[0] ? true : false, this.checkboxData.value, this.table.index);
  39. }
  40. }
  41. };
  42. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  43. return common_vendor.e({
  44. a: $data.isCheck
  45. }, $data.isCheck ? {
  46. b: $data.checkboxData.value + "",
  47. c: $data.checkboxData.checked,
  48. d: common_vendor.o((...args) => $options.checkboxChange && $options.checkboxChange(...args)),
  49. e: $data.thBorder + "px",
  50. f: $data.borderColor
  51. } : {});
  52. }
  53. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "E:/psy_web_share/components/t-table/t-tr.vue"]]);
  54. tt.createComponent(Component);