Skip to content

Commit b5a3534

Browse files
committed
feat: search-bar新增textColor属性
1 parent 0a9e8af commit b5a3534

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

pages/vue/search-bar/search-bar.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</uni-card>
66

77
<uni-section title="基本用法" type="line">
8-
<uni-search-bar @confirm="search" :focus="true" v-model="searchValue" @blur="blur" @focus="focus" @input="input" class="search-result-text" @cancel="cancel" @clear="clear" text-color="#ff261d">
8+
<uni-search-bar textColor="#3c35f4" @confirm="search" :focus="true" v-model="searchValue" @blur="blur" @focus="focus" @input="input" class="search-result-text" @cancel="cancel" @clear="clear" text-color="#ff261d">
99
</uni-search-bar>
1010
<view class="search-result">
1111
<text class="search-result-text">当前输入为:{{ searchValue }}</text>

uni_modules/uni-search-bar/changelog.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 1.2.9(2024-04-17)
2+
- 修复 textColor不生效的bug
13
## 1.2.8(2024-02-22)
24
- 修复 清空按钮emit值错误的bug
35
## 1.2.7(2024-02-21)

uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.vue

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</slot>
99
</view>
1010
<input v-if="show || searchVal" :focus="showSync" :disabled="readonly" :placeholder="placeholderText" :maxlength="maxlength"
11-
class="uni-searchbar__box-search-input" confirm-type="search" type="text" v-model="searchVal"
11+
class="uni-searchbar__box-search-input" confirm-type="search" type="text" v-model="searchVal" :style="{color:textColor}"
1212
@confirm="confirm" @blur="blur" @focus="emitFocus"/>
1313
<text v-else class="uni-searchbar__text-placeholder">{{ placeholder }}</text>
1414
<view v-if="show && (clearButton==='always'||clearButton==='auto'&&searchVal!=='') &&!readonly"
@@ -49,6 +49,7 @@
4949
* @value none 一直不显示
5050
* @property {String} cancelText 取消按钮的文字
5151
* @property {String} bgColor 输入框背景颜色
52+
* @property {String} textColor 输入文字颜色
5253
* @property {Boolean} focus 是否自动聚焦
5354
* @property {Boolean} readonly 组件只读,不能有任何操作,只做展示
5455
* @event {Function} confirm uniSearchBar 的输入框 confirm 事件,返回参数为uniSearchBar的value,e={value:Number}
@@ -86,6 +87,10 @@
8687
type: String,
8788
default: "#F8F8F8"
8889
},
90+
textColor: {
91+
type: String,
92+
default: "#F8F8F8"
93+
},
8994
maxlength: {
9095
type: [Number, String],
9196
default: 100

uni_modules/uni-search-bar/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "uni-search-bar",
33
"displayName": "uni-search-bar 搜索栏",
4-
"version": "1.2.8",
4+
"version": "1.2.9",
55
"description": "搜索栏组件,通常用于搜索商品、文章等",
66
"keywords": [
77
"uni-ui",
@@ -45,7 +45,8 @@
4545
"platforms": {
4646
"cloud": {
4747
"tcb": "y",
48-
"aliyun": "y"
48+
"aliyun": "y",
49+
"alipay": "n"
4950
},
5051
"client": {
5152
"App": {

0 commit comments

Comments
 (0)