Skip to content

Commit

Permalink
fix: 修复searchIcon部分属性无效bug, 完善注释
Browse files Browse the repository at this point in the history
  • Loading branch information
Jau-work committed Mar 30, 2021
1 parent 8f22882 commit fcd257d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
6 changes: 3 additions & 3 deletions components/pi-picker/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default {
type: String,
// 'bottom'
default: picker.toolbarPosition,
validator: function (value) {
validator: function(value) {
return ['top', 'bottom'].includes(value)
}
},
Expand Down Expand Up @@ -162,7 +162,7 @@ export default {
type: String,
// 'single'
default: picker.type,
validator: function (value) {
validator: function(value) {
return ['single', 'multi', 'multi-auto'].includes(value)
}
},
Expand Down Expand Up @@ -267,7 +267,7 @@ export default {
type: String,
// ''
default: picker.closeIconPosition,
validator: function (value) {
validator: function(value) {
return ['', 'tl', 'tr', 'bl', 'br'].includes(value)
}
},
Expand Down
10 changes: 5 additions & 5 deletions components/pi-regions-select/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default {
type: String,
// `bottom`
default: regionsSelect.toolbarPosition,
validator: function (value) {
validator: function(value) {
return ['top', 'bottom'].includes(value)
}
},
Expand Down Expand Up @@ -258,7 +258,7 @@ export default {
type: String,
// 若不指定,则按照弹出位置自动显示在合适的位置
default: regionsSelect.closeIconPosition,
validator: function (value) {
validator: function(value) {
return ['', 'tl', 'tr', 'bl', 'br'].includes(value)
}
},
Expand Down Expand Up @@ -336,7 +336,7 @@ export default {
}
},
tabCurrent() {
return this.getTabItems.findIndex((t) => t.id === this.tabCurrentItem.id)
return this.getTabItems.findIndex(t => t.id === this.tabCurrentItem.id)
},
getRegions() {
const regionsKey = this.tabCurrentItem.id
Expand All @@ -359,7 +359,7 @@ export default {
return tabs
},
isCompleted() {
return this.getTabItems.findIndex((t) => t.text === PLEASE_SELECT_TIP) === -1
return this.getTabItems.findIndex(t => t.text === PLEASE_SELECT_TIP) === -1
}
},
watch: {
Expand Down Expand Up @@ -408,7 +408,7 @@ export default {
}
setTimeout(() => {
// 如果当前tab激活项不是最后一个,向右移动一项
const tabIndex = this.getTabItems.findIndex((t) => t.id === regionsKey)
const tabIndex = this.getTabItems.findIndex(t => t.id === regionsKey)
if (tabIndex !== this.getTabItems.length - 1) {
this.tabCurrentItem = this.getTabItems[tabIndex + 1]
}
Expand Down
17 changes: 12 additions & 5 deletions components/pi-search/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}
]"
>
<view :class="'pi-fz-32 pi-icon-' + searchIcon" :style="[searchIconStyle]" />
<view :class="'pi-fz-32 pi-icon-' + searchIcon" :style="[IconStyle]" />
</view>
<!-- 输入框包裹 -->
<view
Expand Down Expand Up @@ -111,15 +111,16 @@ export default {
// 搜索框形状,可选值为 `square` `round` |`String`| `false` | `round`
shape: {
type: String,
// `'round'`
default: search.shape,
validator: function(value) {
validator: function (value) {
return ['square', 'round'].includes(value)
}
},
// 背景颜色
background: {
type: String,
// `#f2f2f2`
// ``#f5f5f5``
default: search.background
},
// 是否启用清除控件
Expand Down Expand Up @@ -234,7 +235,7 @@ export default {
type: String,
// `'left'`
default: search.searchIconPosition,
validator: function(value) {
validator: function (value) {
return ['left', 'right'].includes(value)
}
},
Expand All @@ -258,7 +259,7 @@ export default {
// `58`
default: search.height
},
// 输入框颜色
// 输入文本颜色
color: {
type: String,
// `#333333`
Expand All @@ -282,6 +283,12 @@ export default {
height: this.getHeight,
...this.inputStyle
}
},
IconStyle() {
return {
color: this.searchIconColor,
...this.searchIconStyle
}
}
},
watch: {
Expand Down

0 comments on commit fcd257d

Please sign in to comment.