| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- var _ = require('./util')
- var extend = _.extend
- /**
- * The exposed Vue constructor.
- *
- * API conventions:
- * - public API methods/properties are prefiexed with `$`
- * - internal methods/properties are prefixed with `_`
- * - non-prefixed properties are assumed to be proxied user
- * data.
- *
- * @constructor
- * @param {Object} [options]
- * @public
- */
- function Vue (options) {
- this._init(options)
- }
- /**
- * Mixin global API
- */
- extend(Vue, require('./api/global'))
- /**
- * Vue and every constructor that extends Vue has an
- * associated options object, which can be accessed during
- * compilation steps as `this.constructor.options`.
- *
- * These can be seen as the default options of every
- * Vue instance.
- */
- Vue.options = {
- replace: true,
- directives: require('./directives/public'),
- elementDirectives: require('./directives/element'),
- filters: require('./filters'),
- transitions: {},
- components: {},
- partials: {}
- }
- /**
- * Build up the prototype
- */
- var p = Vue.prototype
- /**
- * $data has a setter which does a bunch of
- * teardown/setup work
- */
- Object.defineProperty(p, '$data', {
- get: function () {
- return this._data
- },
- set: function (newData) {
- if (newData !== this._data) {
- this._setData(newData)
- }
- }
- })
- /**
- * Mixin internal instance methods
- */
- extend(p, require('./instance/init'))
- extend(p, require('./instance/events'))
- extend(p, require('./instance/state'))
- extend(p, require('./instance/lifecycle'))
- extend(p, require('./instance/misc'))
- /**
- * Mixin public API methods
- */
- extend(p, require('./api/data'))
- extend(p, require('./api/dom'))
- extend(p, require('./api/events'))
- extend(p, require('./api/child'))
- extend(p, require('./api/lifecycle'))
- Vue.version = '1.0.0-alpha'
- module.exports = _.Vue = Vue
|