跳到主要内容

双向数据绑定 v-model 的实现原理

大概

  • input 元素的 value = this.name
  • 绑定 input 事件 this.name = $event.target.value
  • data 更新触发 re-render

https://lzwdot.github.io/docs/26879