Evan You 12 лет назад
Родитель
Сommit
ecb125d33a

+ 0 - 0
src/api/asset-register.js


+ 0 - 0
src/api/config.js


+ 0 - 0
src/api/extend.js


+ 0 - 0
src/api/require.js


+ 0 - 0
src/api/use.js


+ 0 - 0
src/batcher.js


+ 5 - 0
src/binding.js

@@ -0,0 +1,5 @@
+function Binding () {
+    
+}
+
+module.exports = Binding

+ 5 - 0
src/compiler/compiler.js

@@ -0,0 +1,5 @@
+function Compiler () {
+    
+}
+
+module.exports = Compiler

+ 1 - 0
src/config.js

@@ -0,0 +1 @@
+module.exports = {}

+ 5 - 0
src/directive.js

@@ -0,0 +1,5 @@
+function Directive () {
+    
+}
+
+module.exports = Directive

+ 0 - 0
src/emitter.js


+ 15 - 0
src/instance/data.js

@@ -0,0 +1,15 @@
+exports.$get = function (path) {
+    
+}
+
+exports.$set = function (path, val) {
+    
+}
+
+exports.$watch = function (key, cb) {
+    
+}
+
+exports.$unwatch = function (id) {
+    
+}

+ 19 - 0
src/instance/dom.js

@@ -0,0 +1,19 @@
+exports.$appendTo = function () {
+    
+}
+
+exports.$prependTo = function () {
+    
+}
+
+exports.$before = function () {
+    
+}
+
+exports.$after = function () {
+    
+}
+
+exports.$remove = function () {
+    
+}

+ 13 - 0
src/instance/events.js

@@ -0,0 +1,13 @@
+;['emit', 'on', 'off', 'once'].forEach(function (method) {
+    exports[method] = function () {
+        
+    }
+})
+
+exports.$broadcast = function () {
+    
+}
+
+exports.$dispatch = function () {
+    
+}

+ 7 - 0
src/instance/lifecycle.js

@@ -0,0 +1,7 @@
+exports.$mount = function (el) {
+    
+}
+
+exports.$destroy = function () {
+    
+}

+ 0 - 0
src/observer/observer.js


+ 0 - 0
src/observer/watch-array.js


+ 0 - 0
src/observer/watch-object.js


+ 0 - 0
src/parsers/directive.js


+ 0 - 0
src/parsers/expression.js


+ 0 - 0
src/parsers/path.js


+ 0 - 0
src/parsers/template.js


+ 0 - 0
src/parsers/text.js


+ 0 - 1
src/test.js

@@ -1 +0,0 @@
-module.exports = 123

+ 0 - 0
src/transition/css.js


+ 0 - 0
src/transition/js.js


+ 0 - 0
src/transition/transition.js


+ 9 - 0
src/util.js

@@ -0,0 +1,9 @@
+// common utils
+
+exports.mixin = function (target, mixin) {
+    for (var key in mixin) {
+        if (target[key] !== mixin[key]) {
+            target[key] = mixin[key]
+        }
+    }
+}

+ 27 - 6
src/vue.js

@@ -1,7 +1,28 @@
-var test = require('./test')
+var _        = require('./util'),
+    Compiler = require('./compiler/compiler')
 
 
-module.exports = {
-    test: function () {
-        return test
-    }
-}
+/**
+ *  The exposed Vue constructor.
+ */
+function Vue (options) {
+    this._compiler = new Compiler(this, options)
+}
+
+// mixin instance methods
+var p = Vue.prototype
+_.mixin(p, require('./instance/lifecycle'))
+_.mixin(p, require('./instance/data'))
+_.mixin(p, require('./instance/dom'))
+_.mixin(p, require('./instance/events'))
+
+// mixin asset registers
+_.mixin(Vue, require('./api/asset-register'))
+
+// static methods
+Vue.config    = require('./api/config')
+Vue.use       = require('./api/use')
+Vue.require   = require('./api/require')
+Vue.extend    = require('./api/extend')
+Vue.nextTick  = require('./util').nextTick
+
+module.exports = Vue