Przeglądaj źródła

move Vue.options to src/vue

Evan You 11 lat temu
rodzic
commit
08f0ca8f39
4 zmienionych plików z 22 dodań i 20 usunięć
  1. 0 14
      src/api/global.js
  2. 1 0
      src/directives/index.js
  3. 1 0
      src/filters/index.js
  4. 20 6
      src/vue.js

+ 0 - 14
src/api/global.js

@@ -7,20 +7,6 @@ var assetTypes = [
   'component'
 ]
 
-/**
- * Vue and every constructor that extends Vue has an
- * associated options object, which can be accessed during
- * compilation steps as `this.constructor.options`.
- */
-
-exports.options = {
-  directives : require('../directives'),
-  filters    : require('../filters'),
-  partials   : {},
-  effects    : {},
-  components : {}
-}
-
 /**
  * Expose useful internals
  */

+ 1 - 0
src/directives/index.js

@@ -0,0 +1 @@
+module.exports = Object.create(null)

+ 1 - 0
src/filters/index.js

@@ -0,0 +1 @@
+module.exports = Object.create(null)

+ 20 - 6
src/vue.js

@@ -18,6 +18,26 @@ 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`.
+ */
+
+Vue.options = {
+  directives : require('./directives'),
+  filters    : require('./filters'),
+  partials   : {},
+  effects    : {},
+  components : {}
+}
+
 /**
  * Build up the prototype
  */
@@ -72,10 +92,4 @@ extend(p, require('./api/dom'))
 extend(p, require('./api/events'))
 extend(p, require('./api/lifecycle'))
 
-/**
- * Mixin global API
- */
-
-extend(Vue, require('./api/global'))
-
 module.exports = Vue