circle.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. const block0 = {};
  4. const _sfc_main = {
  5. props: {
  6. pro: {
  7. type: Number,
  8. default: 0
  9. },
  10. //起始位置 0-1
  11. start: {
  12. type: Number,
  13. default: 0
  14. },
  15. //圆形大小
  16. size: {
  17. type: Number,
  18. default: 100
  19. },
  20. //线宽度
  21. border_width: {
  22. type: Number,
  23. default: 10
  24. },
  25. //线颜色
  26. border_color: {
  27. type: String,
  28. default: "#07C160"
  29. },
  30. //线背景色
  31. border_back_color: {
  32. type: String
  33. },
  34. //中心内容背景色
  35. background: {
  36. type: String
  37. },
  38. //单位
  39. unit: {
  40. type: String,
  41. default: "rpx"
  42. },
  43. // 内容
  44. content: {
  45. type: String,
  46. default: "0"
  47. },
  48. //是否启用动画
  49. animate: {
  50. type: Boolean,
  51. default: true
  52. }
  53. },
  54. data() {
  55. return {
  56. cpro: 0
  57. };
  58. },
  59. watch: {
  60. pro(val) {
  61. this.cpro = val;
  62. }
  63. },
  64. mounted() {
  65. this.cpro = this.pro;
  66. },
  67. methods: {
  68. sunit(num) {
  69. if (typeof num === "number") {
  70. return num + this.unit;
  71. }
  72. }
  73. }
  74. };
  75. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  76. return common_vendor.e({
  77. a: $data.cpro,
  78. b: $props.animate,
  79. c: `rotate(${$props.start * 360 + 45}deg)`,
  80. d: `${$options.sunit($props.border_width)} solid ${$props.border_color}`,
  81. e: $props.background
  82. }, $props.background ? {
  83. f: $props.background
  84. } : {}, {
  85. g: $props.border_back_color
  86. }, $props.border_back_color ? {
  87. h: `calc(${$options.sunit($props.border_width)} - 1px) solid ${$props.border_back_color}`
  88. } : {}, {
  89. i: common_vendor.t($props.content),
  90. j: $options.sunit($props.size),
  91. k: $options.sunit($props.size)
  92. });
  93. }
  94. if (typeof block0 === "function")
  95. block0(_sfc_main);
  96. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-2577f78a"], ["__file", "D:/project/足球比赛/match_applet/pagesHome/team/components/circle.vue"]]);
  97. wx.createComponent(Component);