@tuya-miniapp/smart-ui 2.3.8-beta-2 → 2.3.8-beta-3

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.
@@ -32,24 +32,26 @@ SmartComponent({
32
32
  direction: '',
33
33
  parentDisabled: false,
34
34
  icon: CheckIcon,
35
+ preventDefault: false,
35
36
  },
36
37
  methods: {
37
38
  updateFromParent() {
38
39
  if (!this.parent) {
39
40
  return;
40
41
  }
41
- const { value, disabled: parentDisabled, direction } = this.parent.data;
42
+ const { value, disabled: parentDisabled, direction, preventDefault } = this.parent.data;
42
43
  this.setData({
43
44
  value,
44
45
  direction,
45
46
  parentDisabled,
47
+ preventDefault,
46
48
  });
47
49
  },
48
50
  emitChange(value) {
49
51
  const instance = this.parent || this;
50
52
  instance.$emit('input', value);
51
53
  instance.$emit('change', value);
52
- if (canIUseModel()) {
54
+ if (canIUseModel() && !this.properties.preventDefault) {
53
55
  instance.setData({ value });
54
56
  }
55
57
  },
@@ -8,6 +8,11 @@ SmartComponent({
8
8
  type: null,
9
9
  observer: 'updateChildren',
10
10
  },
11
+ preventDefault: {
12
+ type: Boolean,
13
+ value: false,
14
+ observer: 'updateChildren',
15
+ },
11
16
  direction: String,
12
17
  disabled: {
13
18
  type: Boolean,
@@ -37,24 +37,26 @@ var relation_1 = require("../common/relation");
37
37
  direction: '',
38
38
  parentDisabled: false,
39
39
  icon: Check_1.default,
40
+ preventDefault: false,
40
41
  },
41
42
  methods: {
42
43
  updateFromParent: function () {
43
44
  if (!this.parent) {
44
45
  return;
45
46
  }
46
- var _a = this.parent.data, value = _a.value, parentDisabled = _a.disabled, direction = _a.direction;
47
+ var _a = this.parent.data, value = _a.value, parentDisabled = _a.disabled, direction = _a.direction, preventDefault = _a.preventDefault;
47
48
  this.setData({
48
49
  value: value,
49
50
  direction: direction,
50
51
  parentDisabled: parentDisabled,
52
+ preventDefault: preventDefault,
51
53
  });
52
54
  },
53
55
  emitChange: function (value) {
54
56
  var instance = this.parent || this;
55
57
  instance.$emit('input', value);
56
58
  instance.$emit('change', value);
57
- if ((0, version_1.canIUseModel)()) {
59
+ if ((0, version_1.canIUseModel)() && !this.properties.preventDefault) {
58
60
  instance.setData({ value: value });
59
61
  }
60
62
  },
@@ -10,6 +10,11 @@ var relation_1 = require("../common/relation");
10
10
  type: null,
11
11
  observer: 'updateChildren',
12
12
  },
13
+ preventDefault: {
14
+ type: Boolean,
15
+ value: false,
16
+ observer: 'updateChildren',
17
+ },
13
18
  direction: String,
14
19
  disabled: {
15
20
  type: Boolean,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/smart-ui",
3
- "version": "2.3.8-beta-2",
3
+ "version": "2.3.8-beta-3",
4
4
  "author": "MiniApp Team",
5
5
  "license": "MIT",
6
6
  "miniprogram": "lib",