Vue組件選項(xiàng)推薦的默認(rèn)順序
- 定義組件
is
- 循環(huán)渲染
v-for
- 條件渲染
v-if
v-else-if
v-else
v-show
v-cloak
- 渲染方式
v-pre
v-once
- 全局感知
id
- 唯一的特性
ref
key
slot
- 雙向綁定
v-model
- 其他特性
- 其他屬性(data)包括自定義屬性
- 事件
v-on
- 內(nèi)容
v-html
v-text
個(gè)人偏愛的順序
- 布爾值屬性(為true)
<my-component disabled />
- 靜態(tài)屬性
<my-component name="my-component" />