在Search.tsx
:
import { SearchInput } from Search.styles.ts
<SearchInput
onChange={handleChange}
value={values["searchValue"]}
placeholder="Search"
type="text"
name="searchValue"
/>
输出html:
<div class="1">
<div class="2">
<div class="3">
<span class="InputWrapper">
<input placeholder="Search" name="searchValue" class="Input input normalVariant" formnovalidate="" type="text" value="" >
</span>
</div>
</div>
</div>
在 Search.styles.ts:
import * as Toolkit from "@some_repo/toolkit";
export const SearchInput = styled(Toolkit.Input)`
InputWrapper: 100%
`
我想要 set InputWrapper: width 100%
,正确的做法是什么?
它就像 css 一样工作。
import * as Toolkit from "@some_repo/toolkit";
export const SearchInput = styled(Toolkit.Input)`
.InputWrapper {
width: 100%;
};
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句