标签:react contact chat for media 定义 组件 对象 dia
function FancyBorder(props) { return ( <div className={‘FancyBorder FancyBorder-‘ + props.color}> {props.children} </div> ); } function WelcomeDialog() { return ( <FancyBorder color="blue"> <h1 className="Dialog-title"> Welcome </h1> <p className="Dialog-message"> Thank you for visiting our spacecraft! </p> </FancyBorder> ); }
function SplitPane(props) { return ( <div className="SplitPane"> <div className="SplitPane-left"> {props.left} </div> <div className="SplitPane-right"> {props.right} </div> </div> ); } function Contacts(props){ return <h1>联系人</h1>; } function Chat(props){ return <h1>聊天室</h1>; } function App() { return ( <SplitPane left={ <Contacts /> } right={ <Chat /> } /> ); }
function Dialog(props) { return ( <FancyBorder color="blue"> <h1 className="Dialog-title"> {props.title} </h1> <p className="Dialog-message"> {props.message} </p> </FancyBorder> ); } function WelcomeDialog() { return ( <Dialog title="Welcome" message="Thank you for visiting our spacecraft!" /> ); }
标签:react contact chat for media 定义 组件 对象 dia
原文地址:https://www.cnblogs.com/gopark/p/12292919.html