我想知道如何使用 react-select 很好地向 Select 添加类型。
到目前为止的组件看起来像这样:
const Select: React.FC<Select> = (
{defaultValue, onChange, options}: Select) => (
<ReactSelect
styles={selectStyles}
…
</ReactSelect>
Run Code Online (Sandbox Code Playgroud)
和的定义selectStyles:
interface HoverProps {
bowShadow: string
border: string
}
interface ControlComponentCSSProperties extends CSSProperties {
'&:hover': HoverProps
}
const selectStyles = {
control: (
provided: CSSProperties,
state: Props<{label: string; value: string}> | Props<Record<string, unknown>>
): ControlComponentCSSProperties => ({
...provided,
'&:hover': {
bowShadow: 'none',
border: 'none',
},
border: 'none',
borderRadius: input.border.radius,
borderBottomLeftRadius: state.menuIsOpen ? 0 : input.border.radius,
borderBottomRightRadius: state.menuIsOpen …Run Code Online (Sandbox Code Playgroud) 我想在vim中打开shell中的两个文件,并排放置,两个文件都滚动到文件的末尾.
截至目前我可以做到
vim -O "+ normal G $" file1 file2
除了将第二个文件滚动到最后,这样做我想要的一切.
非常感谢你