scaffolding

This commit is contained in:
Evan You 2014-07-08 15:57:47 -04:00
parent b41cf22720
commit ecb125d33a
29 changed files with 106 additions and 7 deletions

View File

0
src/api/config.js Normal file
View File

0
src/api/extend.js Normal file
View File

0
src/api/require.js Normal file
View File

0
src/api/use.js Normal file
View File

0
src/batcher.js Normal file
View File

5
src/binding.js Normal file
View File

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

5
src/compiler/compiler.js Normal file
View File

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

1
src/config.js Normal file
View File

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

5
src/directive.js Normal file
View File

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

0
src/emitter.js Normal file
View File

15
src/instance/data.js Normal file
View File

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

19
src/instance/dom.js Normal file
View File

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

13
src/instance/events.js Normal file
View File

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

View File

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

0
src/observer/observer.js Normal file
View File

View File

View File

0
src/parsers/directive.js Normal file
View File

View File

0
src/parsers/path.js Normal file
View File

0
src/parsers/template.js Normal file
View File

0
src/parsers/text.js Normal file
View File

View File

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

0
src/transition/css.js Normal file
View File

0
src/transition/js.js Normal file
View File

View File

9
src/util.js Normal file
View File

@ -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]
}
}
}

View File

@ -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