props如何传递一个number类型的值呢? 而要这么写: 但是这么写,如果别人用你的组件,容易犯错 最好的方法是对标签属性类型进行校验: react中专门对标签属性进行限制的库: 使用: 总结: 注意点: