Giter Site home page Giter Site logo

vue-data-bidirectional-binding-demo's Introduction

Vue数据双向绑定demo

  • vue数据双向绑定原理分析和简单实现
  • 代码总共分为三个版本,v3为最终版本
  • 实现一个监听器Observe,用来劫持并监听所有属性,如果有变动的,就通知订阅者
  • 实现一个订阅者Watcher,可以收到属性的变化通知并执行相应的函数,从而更新视图
  • 实现一个解析器Compile,可以扫描和解析每个节点的相关指令,并根据初始化模板数据以及初始化相应的订阅器(v-model绑定功能的实现)

效果图

Mou icon

博客地址

https://mp.csdn.net/postedit/81839368

自我思考

  • 代码是从他人那里fork的,这里不仅仅说明这个数据双向绑定的原理,关机是代码组织方式非常的好
  • 是一种面向对象的编码方式,将一个功能由三个对象所组成,十分值得借鉴

vue-data-bidirectional-binding-demo's People

Contributors

mouyao avatar canfoo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.