【发布时间】:2022-04-08 03:04:11
【问题描述】:
我的样式化组件上有一个接口,其中包含每个属性的类型提示。如下图:
interface PBProps {
color: Colours;
bgColor: Colours;
/** for example: 10px or 10% */
height: string;
paddingLR: string;
fontSize: string;
width: string;
margin: string;
fontWeight: string;
}
当您将鼠标悬停在实际元素的高度上时,这个想法就是如此。我有一个评论节目。
所以它在具有(JSX attribute) height: string 的同一个框中显示“例如:10px 或 10%”
我知道你可以这样做:
/**
* @param {string} height // comment
*/
但这并没有达到我希望达到的效果。这甚至可能吗。 2天的搜索已经够远了!我的google FU不够强!
【问题讨论】:
标签: reactjs typescript styled-components