• Stars
    star
    239
  • Rank 168,763 (Top 4 %)
  • Language
    JavaScript
  • Created about 7 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Deadly simple implement of Vuejs2.x

tiny-vue

What is this?

中文版文档

There is several detailed articles show how to write tiny-vue (in Chinese) Diving into Vue1.0 source code

A dead simple implement of vuejs, use to learn the source code of vuejs (v1.0.28). Vuejs source code is very elegant, but it's difficult for beginner to understand. You can try to learn this project, it will be very helpful to understand vuejs. Most of lifecycle, modular and function name is same to vuejs, but all the code is rewrited (except dep.js and very few function implements)

There are two main part:

  1. state: reactive state, listen to state's change, State -> Observer -> Dep -> Watcher
  2. directive: support directive, you can add your own directives: Compile -> Directive -> directives

You can use it ike this:

<div id="a">
	<input v-model="message" />
	<button v-on:click="increase">Increase</button>
	<p v-text="message"></p>
</div>
<script>
	new Vue({
		el: "#a",
		data: {
			message: 1
		},
		methods: {
			increase () {
				this.message += 1
			}
		}
	})
</script>

Supported Features

  1. reactive data.
  2. interal directives: v-on:click, v-text, v-model
  3. two-way data binding
  4. more feature is coming

implements

1 2 3 4

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

For detailed explanation on how things work, consult the docs for vue-loader.

More Repositories

1

jquery-weui

由于前端业界早已以React/Vue/Angular为主,个人也多年未使用过jQuery,此仓库已不再维护。推荐大家尽快转向 AntD、Element等更先进的UI库,https://ant.design/, https://element.eleme.io/#/zh-CN
JavaScript
4,458
star
2

gobang

javascript gobang AI,JS五子棋AI,源码+教程,基于Alpha-Beta剪枝算法(不是神经网络)
JavaScript
1,523
star
3

myblog

言川的博客-前端工程师的笔记
1,382
star
4

diving-into-webpack

webpack 源码解析系列
740
star
5

tensorflow2-course

网易云课程《深度学习与TensorFlow 2入门实战》,《Tensorflow深度学习入门与实战》课程代码
Python
20
star
6

light7-cn

light7 网站,不在维护,请尽快迁移至 jqweui
JavaScript
16
star
7

blankweb

JavaScript
11
star
8

vue-webpack-todo-list

todolist by vue and webpack
JavaScript
9
star
9

my-webpack-loader

JavaScript
6
star
10

todolist

todolist, a chrome extension
JavaScript
4
star
11

alpha-zero-gobang

alpha zero 原理实现五子棋 AI,tensorflow
Python
3
star
12

javaworkbench

Simple javaworkbench, i use this to write some interesting java project.
Java
3
star
13

gobang-cnn

尝试用chatgpt写一个神经网络版本的五子棋AI
Python
2
star
14

gobang-v2

JavaScript
1
star
15

suspense-demo

react suspense demo
JavaScript
1
star
16

vue2-simple-app

研究源码专用APP
JavaScript
1
star
17

vue3-test

使用Vue3实现一个简单的计数器,展示Vue3用法
Vue
1
star
18

42lines-vue3-reactivity

42行代码实现Vue3响应式
JavaScript
1
star
19

vue-todolist

Todo list writen with Vue
JavaScript
1
star