1. 在函数组件实现跨组件通信的方式
2. 注册Context将value传递给子组件
let MyContext = React.createContext('默认值');
<MyContext.Provider value={} >
let value = useContext(MyContext)
<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><metahttp-equiv="X-UA-Compatible"content="IE=edge"><metaname="viewport"content="width=device-width, initial-scale=1.0"><title>Document</title><style></style><scriptsrc="../react.development.js"></script><scriptsrc="../react-dom.development.js"></script><scriptsrc="../babel.min.js"></script><scriptsrc="../lodash.min.js"></script></head><body><divid="app"></div><scripttype="text/babel">// 实现三层组件的跨组件通信letWelcome=(props)=>{return(<div>
hello Welcome
<MyContext.Provider value="welcome的问候~~~"><Head /></MyContext.Provider></div>);}letHead=()=>{return(<div>
hello Head
<Title /></div>);}letTitle=()=>{let value =useContext(MyContext);return(<div>
hello Title,{ value }</div>);}let element =(<Welcome />);
root.render(element);</script></body></html>
echo 打印命令 : 显示字符串 :
[rootserver ~]# echo this is SHELL language
this is SHELL language
[rootserver ~]# echo this is SHELL language
this is SHELL language
[rootserver ~]# echo "this is SHELL language"
this is SH…
第1步---MySQL安装和配置 1.下载地址
MySQL :: Download MySQL Community Server (Archived Versions)
直接下载zip形式的就可以。 2.在bin的同级目录下常见my.ini文件。
输入下面的内容
my.ini中的文本:
[mysqld]
#设置3306端口
port3306
character-set-server…