标签:元素对象 reac src code 操作dom java div script class
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>01_HelloWorld</title> </head> <body> <div id="test"></div> <script type="text/javascript" src="../js/react.development.js"></script><!--react核心库--> <script type="text/javascript" src="../js/react-dom.development.js"></script><!--操作dom的react扩展库--> <script type="text/javascript" src="../js/babel.min.js"></script><!--在这里——>解析JSX语法代码转为纯JS语法代码的库--> <script type="text/babel"> // 1.创建虚拟dom元素对象 JSX语法 var vDom = <h1>hello react!!!</h1> // 2.将虚拟dom渲染到页面真实的dom容器中 ReactDOM.render(vDom, document.getElementById(‘test‘)) </script> </body> </html>
标签:元素对象 reac src code 操作dom java div script class
原文地址:https://www.cnblogs.com/zhanzhuang/p/10703321.html