Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #245 from GJJDD/dev
Browse files Browse the repository at this point in the history
[!] theme and barStyle compatible
  • Loading branch information
tw93 committed Apr 19, 2018
2 parents fcd2b3d + 0b6f677 commit 82823be
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/wxc-searchbar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
@click="closeClicked"
:src="closeIcon"></image>
<text :class="['search-bar-button','search-bar-button-'+theme]"
:style="buttonStyle"
v-if="needShowCancel"
@click="cancelClicked">{{cancelLabel}}</text>
</div>
Expand Down Expand Up @@ -241,6 +242,13 @@
computed: {
needShowCancel () {
return this.alwaysShowCancel || this.showCancel;
},
buttonStyle () {
const { barStyle } = this;
if (barStyle.backgroundColor) {
return {backgroundColor:barStyle.backgroundColor}
}
return {}
}
},
data: () => ({
Expand All @@ -250,6 +258,7 @@
showCancel: false,
showClose: false,
value: ''
}),
created () {
this.defaultValue && (this.value = this.defaultValue);
Expand Down

0 comments on commit 82823be

Please sign in to comment.