為什么選項要有統(tǒng)一的書寫順序呢?很簡單,就是要將選擇和認(rèn)知成本最小化。文章來源地址http://www.zghlxwxcb.cn/news/detail-801600.html
-
副作用?(觸發(fā)組件外的影響)
el
-
全局感知?(要求組件以外的知識)
- name
- parent
-
組件類型?(更改組件的類型)
functional
-
模板修改器?(改變模板的編譯方式)
delimiters
comments
-
模板依賴?(模板內(nèi)使用的資源)
components
directives
filters
-
組合?(向選項里合并屬性)
extends
mixins
-
接口?(組件的接口)
inheritAttrs
model
-
props
/propsData
-
本地狀態(tài)?(本地的響應(yīng)式屬性)
data
computed
-
事件?(通過響應(yīng)式事件觸發(fā)的回調(diào))
beforeCreate
created
beforeMount
mounted
beforeUpdate
updated
activated
deactivated
beforeDestroy
destroyed
watch
- 生命周期鉤子 (按照它們被調(diào)用的順序)
-
非響應(yīng)式的屬性?(不依賴響應(yīng)系統(tǒng)的實(shí)例屬性)
methods
-
渲染?(組件輸出的聲明式描述)
-
template
/render
renderError
-
文章來源:http://www.zghlxwxcb.cn/news/detail-801600.html
到了這里,關(guān)于組件中寫選項的順序(vue的問題)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!