@leevan/jtui 2.0.54-beta.4 → 2.0.54-beta.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leevan/jtui",
3
- "version": "2.0.54-beta.4",
3
+ "version": "2.0.54-beta.5",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -132,6 +132,10 @@ export default {
132
132
  watch: {
133
133
  value(newVal) {
134
134
  this.currentValue = newVal;
135
+ },
136
+ // 监听 currentValue 变化,实时同步给父组件
137
+ currentValue(newVal) {
138
+ this.$emit('input', newVal);
135
139
  }
136
140
  },
137
141
  mounted() {
@@ -152,7 +156,6 @@ export default {
152
156
  this.doComplete();
153
157
  },
154
158
  doComplete() {
155
- this.$emit('input', this.currentValue);
156
159
  this.closeEdit();
157
160
  },
158
161
  closeEdit() {
@@ -262,11 +262,8 @@ export default {
262
262
  return findItem ? findItem.label : (value || '请选择');
263
263
  },
264
264
  handleInputChange(val, row, prop) {
265
- if (!(prop in row)) {
266
- this.$set(row, prop, val);
267
- } else {
268
- row[prop] = val;
269
- }
265
+ // 无论字段是否存在,都使用 $set 来确保响应式
266
+ this.$set(row, prop, val);
270
267
  },
271
268
  toggleDropdown() {
272
269
  this.isOpen = !this.isOpen;