GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - wushufen/vm: 从零实现mvvm框架,重写一个轻量的vue兼容ie所有版本

BranchesTags
Open more actions menu

Latest commit

 

History

171 Commits
171 Commits

Folders and files

NameName
Last commit message
Last commit date
examples
examples
 
 
.eslintrc.js
.eslintrc.js
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
idea.md
idea.md
 
 
vm.js
vm.js
 
 

Repository files navigation

vm.js

这是一个独立自研的 mvvm 框架,只是语法跟 vue 一致,底层原理跟 vue 是完全不一样的, vue 无法兼容 ie8 及以下。 本框架没有用到 Object.defineProperty() 等 es5, es6 特性,基于 es3,兼容性强,可用于需要兼容 ie 的项目。 超轻量,可考虑用于 活动页、广告投放页 等轻量的项目。

实现原理如下:
从零实现mvvm框架,重写一个轻量的vue并兼容ie

特性

  • 兼容 ie 所有版本
  • 超轻量压缩gzip才 3k
  • 与 vue 语法完全一致,实现了常用的功能

示例

<!DOCTYPE html>
<html>
<head>
  <title>hello world</title>
  <script src="../vm.js"></script>
</head>
<body>
  <div id="app">
    <input v-model="model"> {{model}}
  </div>
  <script>
    var vm = new Vue({
      el: '#app',
      data: {
        model: 'hello vm.js'
      }
    })
  </script>
</body>
</html>

演示

可在ie6下测试

  • hello world | 源码
  • form | 源码
  • todo list | 源码
  • template error | 源码
  • svg (需浏览器支持 ie9+) | 源码

已实现的功能列表

  • {{插值表达式}}
  • v-model
  • v-if
  • v-for
  • v-bind:prop :prop
  • v-on:event @event
    • .prevent.stop.self.ctrl.alt.shift.meta.enter.(keycode)
  • :class
  • :style
  • options
    • el
    • template
    • render
    • data
    • methods
    • created
    • mounted
  • VM.prototype.$mount
  • VM.directive

About

从零实现mvvm框架,重写一个轻量的vue兼容ie所有版本

Resources

Readme
Activity

Stars

21 stars

Watchers

3 watching

Forks

5 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.