摘要: 阅读全文
posted @ 2022-11-02 18:36 前端导师歌谣 阅读(29) 评论(0) 推荐(0)
摘要: app.js const App = () => { return <div>我是App组件!</div> }; // 导出App export default App; index.js /* * 组件 * - React中组件有两种创建方式 * - 函数式组件 * - 函数组件就是一个返回JSX 阅读全文
posted @ 2022-11-01 10:57 前端导师歌谣 阅读(16) 评论(0) 推荐(0)
摘要: index.html <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>React项目</title> </head> <body> <div id="root"></div> <!-- public/inde 阅读全文
posted @ 2022-11-01 10:56 前端导师歌谣 阅读(33) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>JSX的注意</title> <script src="script/react.development.js"></script> <script src=" 阅读全文
posted @ 2022-11-01 10:55 前端导师歌谣 阅读(24) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>三个API</title> <script src="script/react.development.js"></script> <script src="s 阅读全文
posted @ 2022-11-01 10:54 前端导师歌谣 阅读(25) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>Hello World</title> <!--引入react的核心库--> <script src="script/react.development.js" 阅读全文
posted @ 2022-11-01 10:53 前端导师歌谣 阅读(42) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>继承</title> <script> // 将多个类中的重复代码提取出来 class Animal{ constructor(name, age) { thi 阅读全文
posted @ 2022-11-01 10:52 前端导师歌谣 阅读(40) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>类</title> <script> /* * 类 * - 类是对象的模板 * - 类决定了一个对象中有哪些属性和方法 * - 使用class关键字来定义一个类 阅读全文
posted @ 2022-11-01 10:51 前端导师歌谣 阅读(9) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>箭头函数</title> <script> /* * 1.箭头函数中没有arguments * 2.箭头函数中没有自己的this * - 它的this总是外层作 阅读全文
posted @ 2022-11-01 10:51 前端导师歌谣 阅读(39) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-10-31 09:31 前端导师歌谣 阅读(21) 评论(0) 推荐(0)