theJiawen / Simplified-Vue

Try to implement a simplified Vue.

Home Page:http://www.laijiawen.com/projects/my-vue/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

Simplified-Vue try to implement a very simplified vue, with basic two-way binding.

Features

  • directives:

    • v-model
    • v-bind: and it's shorthand :
  • template: {{ whatever }}

  • computed

How to run

Open index.html.

How to test if it work

Try typing codes below in the console and observe the changes in DOM:

app.age = 10;

app.description = "A cute girl";

app.bestFriend.link = "https://www.baidu.com"

Try changing the value of <input> and log the app.description

console.log(app.description);

todos

  • 使用 Proxy 进行数据劫持
  • 编译模板
  • 发布-订阅模式实现数据到视图的绑定
  • computed
  • methods

About

Try to implement a simplified Vue.

http://www.laijiawen.com/projects/my-vue/


Languages

Language:JavaScript 88.8%Language:HTML 11.2%