所以,首先,我这样声明我的组件:
import styled from 'styled-components';
import {
space, color, layout, flexbox, border,
} from 'styled-system';
const FlexWrapper = styled.div`
display: flex;
gap: ${({ gap }) => gap || '10px'};
${layout};
${space};
${color};
${flexbox};
${border};
`;
export default FlexWrapper;
然后我就用它:
return (
<FlexWrapper flexDirection='column' width={width}>
<FlexWrapper flexDirection='row' gap='30px'>
{filters}
</FlexWrapper>
</FlexWrapper>
);
最终,道具工作正常,但 vscode intellisense 根本看不到它。有什么解决方案可以解决它吗?