// 函数 getNotificationsCount 已经可以直接调用
class Notification extends Component {
render () {
let count = getNotificationsCount();
// TODO
return <span>{count>0?'有(' + count + ')条':'没有'}未读消息</span>
}
}
Y
yodfz 发布的帖子
-
RE: #2 用 React.js 构建未读消息组件