@tuya-miniapp/smart-ui 2.6.1 → 2.6.2-beta-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,6 +29,7 @@ SmartComponent({
29
29
  },
30
30
  backgroundColor: String,
31
31
  onCalcColor: null,
32
+ color: String,
32
33
  },
33
34
  data: {
34
35
  svgUrl: '',
@@ -75,6 +76,9 @@ SmartComponent({
75
76
  return 'rgba(0, 0, 0, 0.5)';
76
77
  },
77
78
  calcColor(top) {
79
+ if (this.data.color) {
80
+ return this.data.color;
81
+ }
78
82
  // 自定义电量的颜色分配规则
79
83
  const color = typeof this.data.onCalcColor === 'function' && this.data.onCalcColor();
80
84
  if (color) {
@@ -31,6 +31,7 @@ var wrapBatteryD = 'M6.5,0 C6.77614237,-5.07265313e-17 7,0.223857625 7,0.5 L7,1
31
31
  },
32
32
  backgroundColor: String,
33
33
  onCalcColor: null,
34
+ color: String,
34
35
  },
35
36
  data: {
36
37
  svgUrl: '',
@@ -70,6 +71,9 @@ var wrapBatteryD = 'M6.5,0 C6.77614237,-5.07265313e-17 7,0.223857625 7,0.5 L7,1
70
71
  return 'rgba(0, 0, 0, 0.5)';
71
72
  },
72
73
  calcColor: function (top) {
74
+ if (this.data.color) {
75
+ return this.data.color;
76
+ }
73
77
  // 自定义电量的颜色分配规则
74
78
  var color = typeof this.data.onCalcColor === 'function' && this.data.onCalcColor();
75
79
  if (color) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/smart-ui",
3
- "version": "2.6.1",
3
+ "version": "2.6.2-beta-0",
4
4
  "author": "MiniApp Team",
5
5
  "license": "MIT",
6
6
  "miniprogram": "lib",