react之第乙個元件的定義及使用

2022-06-10 05:42:11 字數 786 閱讀 8293

//header.js

import  react from "react"; //"react",如果r寫成大寫的話,瀏覽器裡會出現警告

//如果不寫export default,外部將訪問不到

export default class componentheader extends react.component

}

//footer.js
import react from "react";

export default class componentfooter extends react.component

}

//其它的js裡引用header.js元件

import componentheader from "./header"

import footer from "./footer"

import reactdom from "react-dom"

class index extends react.componentelse

//每個return裡只能返回乙個節點多個會報錯

return()}}

reactdom.render(,document.getelementbyid('entry'));//往整個專案裡做繫結,entry是專案入口的html裡的id值

react的第乙個頁面

2 執行命令 3 了解基本的react組成 react 基本用法 判斷 迴圈 變數 react dom 頁面操作 react script 針對專案命令管理 npm run start 啟動專案 npm run build 打包專案 4 進入lesson21 cd lesson21 6 了解誒專案的...

python第乙個程式設計 第乙個 Python 程式

簡述 安裝完 python 後,windows 中 開始選單或安裝目錄下就會有 idle 開發 python 程式的基本 ide 整合開發環境 幫助手冊 模組文件等。linux 中 只需要在命令列中輸入 python 命令即可啟動互動式程式設計。互動式程式設計 互動式程式設計不需要建立指令碼檔案,是...

SpringBoot之第乙個Restfu示例

前面把資料庫研究了差不多了。今天開始研究control層了。如何接收restful的http請求。這裡在類上面加上 restcontroller 這個類就可以接收rest的請求了。但是http請求有千萬種,我們如何知道哪個請求進入哪個類呢?這裡就需要引入另外乙個註解 如果我在請求的時候,帶有乙個js...