Skip to content

Commit

Permalink
Merge pull request #6 from ZhonganTechENG/dev
Browse files Browse the repository at this point in the history
fixed single picker display bug
  • Loading branch information
chuanshuoye authored Feb 12, 2018
2 parents 7f26a76 + 57774be commit 657f885
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
![JS gzip size](http://img.badgesize.io/https://unpkg.com/zarm-vue@latest/zarm-vue.umd.js?compression=gzip&label=gzip%20size:%20JS)
![CSS gzip size](http://img.badgesize.io/https://unpkg.com/zarm-vue/zarm-vue.default.css?compression=gzip&label=gzip%20size:%20CSS)

[众安科技zarm移动端组件库](https://github.com/ZhonganTechENG/zarm) **的 Vue.js版本**

### Example 案例

Expand Down Expand Up @@ -67,8 +66,5 @@ npm run build:theme
```
新生成的样式文件: `lib/zarm-vue.default.css`

### Changelog 更新日志
[CHANGELOG.md](https://github.com/ZhonganTechENG/zarm-vue/blob/master/CHANGELOG.md)

### License
MIT
4 changes: 2 additions & 2 deletions example/components/pickerPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ export default {
v11:['1', '12'],
District,
data1:[
{ value: '1', label: '选项一' },
{ value: '2', label: '选项二' },
{ value: 'I', label: '选项一' },
{ value: 'TB', label: '选项二' },
],
data2:[
[
Expand Down
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.0.1",
"version": "1.0.2",
"description": "zarm in vue",
"author": "chrisHchen <[email protected]>",
"tags": [
Expand Down
5 changes: 4 additions & 1 deletion src/picker/src/picker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@
}
// FIXED
const treeChildren2 = data.map((d, index) => {
if (currentValue[index]) {
if (!isArray(currentValue)) {
return d.filter(obj => currentValue === obj[this.valueMember])[0];
}
if (isArray(currentValue) && currentValue[index]) {
return d.filter(obj => currentValue[index] === obj[this.valueMember])[0];
}
return undefined;
Expand Down

0 comments on commit 657f885

Please sign in to comment.