Skip to content

Commit

Permalink
fix: singleColumn Picker getValue when default value = ‘’
Browse files Browse the repository at this point in the history
event @ok v-model return ArrayFormat
  • Loading branch information
叶展旺 authored and 叶展旺 committed Nov 20, 2018
1 parent 5494d36 commit c91635f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zarm-vue",
"version": "1.3.0",
"version": "1.4.1",
"description": "zarm in vue",
"tags": [
"zarm",
Expand Down
6 changes: 4 additions & 2 deletions src/picker/src/picker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,11 @@ export default {
if (this.cascade) {
return formatToInit(data[0], valueMember, cols);
}
return data.map(d => (d[0][valueMember]));
const value = data.map(d => (d[0][valueMember]));
return this.isSingleColumn ? value[0] : value;
}
return currentValue;
// return currentValue;
return this.isSingleColumn && isArray(currentValue) ? currentValue[0] : currentValue;
},
display() {
const { currentValue, data } = this;
Expand Down

0 comments on commit c91635f

Please sign in to comment.