@tripup-company/element-ui-extended 0.0.85 → 0.0.86

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": "@tripup-company/element-ui-extended",
3
- "version": "0.0.85",
3
+ "version": "0.0.86",
4
4
  "main": "./dist/element-ui-extended.umd.js",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve && tsc --emitDeclarationOnly",
@@ -108,6 +108,8 @@
108
108
  </template>
109
109
 
110
110
  <script>
111
+ import lodash from "lodash";
112
+ const _ = lodash;
111
113
  export default {
112
114
  name: "EditableField",
113
115
  model: {
@@ -215,6 +217,11 @@ export default {
215
217
  },
216
218
  },
217
219
  },
220
+ watch: {
221
+ selectList: function() {
222
+ this.selectListLocal = _.cloneDeep(this.selectList);
223
+ },
224
+ },
218
225
  methods: {
219
226
  createList() {
220
227
  let label = "";
@@ -235,9 +242,12 @@ export default {
235
242
  label = "-";
236
243
  }
237
244
  } else if (this.selectListLocal.length) {
238
- label = this.selectListLocal.find((x) => x[this.selectKey] === this.value)[
239
- this.selectLabel
240
- ];
245
+ let obj = this.selectListLocal.find((x) => x[this.selectKey] === this.value);
246
+ if (typeof(obj) != "undefined") {
247
+ label = obj[this.selectLabel];
248
+ } else {
249
+ console.log(this.value + ' not found in ' + this.selectListLocal.map(x => x[this.selectKey]));
250
+ }
241
251
  } else {
242
252
  label = this.value;
243
253
  }
@@ -253,6 +263,9 @@ export default {
253
263
  this.$emit("editable:close");
254
264
  },
255
265
  async remoteCall(query) {
266
+ if (!query.length) {
267
+ return;
268
+ }
256
269
  this.loading = true;
257
270
  const response = await this.remoteMethod.all({
258
271
  search: this.selectLabel + ":" + query,