something about vue

  • Options API > Composition API, 但兩者都要學 (options api 本身都係 on top of Composition)
  • data() 即係 reactive state
  • this. 其實佢有好多自動野加左落隻 object 到 已經唔係原本隻 object 了
  • :class :style = v-bind:class v-bind:style
  • v-bind 就係扭個 html attribute value 既工具
  • props 主要係 read-only, 寫 html attribute 到射入 component, 又可以 parent to children
  • props html 係可以用 hyphenated, 入到 js 自動變 CamelCase
  • @ 即係 addEventListener
  • emits 即係 dispatchEvent
  • 你可以 explicit 咁 declare d event, 咁樣就唔會同 native 撞
  • slot 即係將 html value 當 parameter 咁隊入 component html
  • vue 係 shorthand 工具 同一個做法可以用好多方法寫 又好多自動左既 transformation 要睇清楚 manuel
  • ref 即係內置 dictionary, 等你可以加d html element 入去, 被其他去 call
  • v-model 即係 mvc 既 model, 類面係裝 object data 既
  • watch 即係 onchange 咁用, 或者改 value 個陣攝隻手埋去
  • computed 即係 cached get