小编Lam*_*005的帖子

创建新组件并从 styled-component 继承样式

const Button = styled.button`
  display: inline-block;
  width: 300px;
  background-color: black;
`    

const ButtonHref = styled.a`
  ${Button}
`   
Run Code Online (Sandbox Code Playgroud)

所以我有两个样式组件。我想继承“按钮”样式但创建另一个标签。我使用反应情绪。我怎样才能做到这一点?

javascript emotion styled-components

16
推荐指数
2
解决办法
8370
查看次数

标签 统计

emotion ×1

javascript ×1

styled-components ×1