建立前 beforeCreatevue
建立 createreact
掛載前 beforeMountajax
掛載 mounted服務器
更新前 beforeUpdateapp
更新 updatedthis
銷燬前 beforeDestroyedspa
銷燬 destoryedcomponent
methods --方法orm
-----------------------------------華麗的分割線-------------------------生命週期
一個React組件的生命週期分爲三個部分:掛載期(Mounting)、存在更新期(Updating)和銷燬時(Unmounting)。
在 componentDidMount方法中放ajax請求--服務器會根據變量渲染, Constructor中設置變量初始化
若是你以爲個人文章對您有幫助,給點鼓勵,謝謝