@panpanzhao/component-ui 0.0.25 → 0.0.26

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.
@@ -168,18 +168,7 @@ var external_lodash_ = __webpack_require__(2);
168
168
  watch: {
169
169
  value: function value(val) {
170
170
  //监听form的formModel变化,处理config的value变化
171
- if (this.config.value === val) {
172
- return false;
173
- }
174
- this.setValue(val);
175
- this.execEvent("input", val);
176
- if (this.form && this.form.formModel) {
177
- this.$emit("formItemChange", {
178
- itemConfig: this.config,
179
- itemProp: this.prop,
180
- itemVal: val
181
- });
182
- }
171
+ this.initValue(val);
183
172
  }
184
173
  },
185
174
  computed: {
@@ -240,7 +229,27 @@ var external_lodash_ = __webpack_require__(2);
240
229
  });
241
230
  }
242
231
  },
232
+ created: function created() {
233
+ var formModel = this.form.formModel;
234
+ if (formModel) {
235
+ this.initValue(formModel[this.prop]);
236
+ }
237
+ },
243
238
  methods: {
239
+ initValue: function initValue(val) {
240
+ if (this.config.value === val) {
241
+ return false;
242
+ }
243
+ this.setValue(val);
244
+ this.execEvent("input", val);
245
+ if (this.form && this.form.formModel) {
246
+ this.$emit("formItemChange", {
247
+ itemConfig: this.config,
248
+ itemProp: this.prop,
249
+ itemVal: val
250
+ });
251
+ }
252
+ },
244
253
  execEvent: function execEvent(eventName) {
245
254
  var _this2 = this,
246
255
  _itemEvent$exec;