The Wayback Machine - https://web.archive.org/web/20210110050335/https://github.com/bowencool/bue
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Readme.md

Bue

NPM version

自己写的MVVM框架, Demo

注意:此项目仅供学习使用,不适用于生产环境!

Todos

  • 事件绑定
  • 双向绑定
  • 计算属性
  • 观察数组变化
  • Proxy代替defineProperty(v1)
  • 虚拟DOM
  • nextTick

安装

  • 使用 npm
npm i buejs
import Bue from 'buejs'
  • 在浏览器中
<script scr="//unpkg.com/buejs"></script>
<!-- or -->
<script scr="//cdn.jsdelivr.net/npm/buejs"></script>

使用

<div id="app">
	<h1>{{ name }}</h1>
	<h2>{{ msg }}</h2>
	<input b-model="name" />
	<button @click="reset">reset</button>
</div>
new Bue({
	el: '#app',
	data() {
		return {
			name: INIT_NAME,
		};
	},
	computed: {
		msg() {
			return this.name
				.split('')
				.reverse()
				.join('');
		},
	},
	methods: {
		reset() {
			this.name = INIT_NAME;
		},
	},
})

特别感谢

You can’t perform that action at this time.