Giter Club home page Giter Club logo

mvvm's Introduction

演示地址

https://vkm0303.github.io/mvvm/demo.html

Finished

  • 双向数据绑定
  • 使用 mvvm 实例里的 methods 中的方法进行 click 事件绑定
  • 模拟 v-show 指令

Todo

  • 模拟 compute
  • 模拟钩子函数

存留问题

当一个变量同时绑定了两个节点的时候,更新数据是,只有一个节点的值会更新

<div class="on flex">
  <h4>{{title1}}</h4>
  <div class="content">
    <p>{{title1}}</p>
  </div>
</div>
<div class="flex">
  <h4 v-show="isShow">{{title4}}</h4>
  <div>{{isShow}}</div>
  <button @click="isShowTitle">{{buttonText}}</button>
</div>

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.