Giter Site home page Giter Site logo

likevue's Introduction


1 看了那么多次VUE源码之后,知道了观察者模式+Object.defineProperty数据劫持,动态监测data来渲染页面
2 于是自己动手写一个,更能深刻理解,也能在自己写的时候发现自己哪里没有完全明白。
3 花了俩小时,断断续续的改了几次,写出来了。
4 主要就是四个类
5 MvvM入库类
6 Watcher类 对应于html的每一个{{}}节点
7 Observer类 对应于data里面的属性,维护着多个watcher对象
8 Compile类 初始化加载页面元素,并通过正则表达式解析出对应于data属性的节点,创建对应watcher添加到观察者对象里面

likevue's People

Contributors

shuihan03 avatar

Watchers

James Cloos avatar  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.