Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Vue.jsを数ヶ月使ってみて遭遇した問題とその解決策

 Vue.jsを数ヶ月使ってみて遭遇した問題とその解決策

Data Binding JS Night
〜データバインディングなんでもLT大会@LINEオフィス〜

positiveflat

May 27, 2015
Tweet

More Decks by positiveflat

Other Decks in Programming

Transcript

  1. ͸͡Ίʹ…Vue.jsͷ؆୯ͳ঺հ • ΠϯλϥΫςΟϒwebΠϯλʔϑΣʔεΛߏங͢ΔͨΊͷMVVM(Model, View, ViewModel) ΫϥΠΞϯτϑϨʔϜϫʔΫ • ૒ํ޲σʔλόΠϯσΟϯά • σΟϨΫςΟϒͱͯ͠ɺDOMͷॲཧΛΧελϚΠζͯ͠ఏڙͰ͖Δɻ

    • σʔλͷఆٛ΍DOMͷߏஙͳͲΛ·ͱΊͯɺͦͷ෦඼Λίϯϙʔωϯτͱͯ͠࡞੒ ͢Δ͜ͱ͕Ͱ͖Δɻ • ܰྔ • γϯϓϧͰֶशίετ͕௿͍ • ͨͩ͠…ES5४ڌͷϒϥ΢βαϙʔτΛલఏͱ͍ͯ͠ΔͷͰɺIE8͸αϙʔτ֎
  2. ໰୊1. $dataʹ஋Λ଍ͯ͠΋มߋ͕ݕ஌͞Εͳ͍ [ղܾࡦ]
 $add, $delete (, $set)Λ࢖͏
 …ͪΌΜͱdocumentΛಡΜͰ͍ͳ͍ͱͿ͔ͭΔ໰୊ɻ
 
 “Due

    to the limitations of ES5, Vue cannot detect properties directly added to or deleted from an Object, so use this method and vm.$delete when you need to do so.”