Skip to content

Commit 3d467b1

Browse files
authored
fix(input): 显示设置 placeholder 字体颜色 (#3050)
1 parent 5b8f790 commit 3d467b1

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/packages/input/input.scss

+6-4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
font-size: $input-font-size;
99
box-sizing: border-box;
1010

11+
.nut-input-native .weui-input::placeholder,
12+
&-placeholder {
13+
color: rgb(117, 117, 117);
14+
font-size: $input-font-size;
15+
}
16+
1117
.nut-icon {
1218
color: $color-text-disabled;
1319
width: 14px;
@@ -52,7 +58,3 @@
5258
-webkit-text-fill-color: $color-text-disabled;
5359
}
5460
}
55-
56-
.nut-input-clear {
57-
// flex: 0;
58-
}

src/packages/input/input.taro.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ export const Input = forwardRef(
7777
>,
7878
ref
7979
) => {
80+
const classPrefix = 'nut-input'
81+
8082
const rtl = useRtl()
8183
const { locale } = useConfig()
8284
const {
@@ -135,7 +137,6 @@ export const Input = forwardRef(
135137
})
136138

137139
const inputClass = useCallback(() => {
138-
const classPrefix = 'nut-input'
139140
return [
140141
classPrefix,
141142
`${disabled ? `${classPrefix}-disabled` : ''}`,
@@ -222,6 +223,7 @@ export const Input = forwardRef(
222223
placeholder={
223224
placeholder === undefined ? locale.placeholder : placeholder
224225
}
226+
placeholderClass={`${classPrefix}-placeholder`}
225227
disabled={disabled || readOnly}
226228
value={value}
227229
focus={autoFocus}

0 commit comments

Comments
 (0)