index.js 466 B

12345678910111213141516
  1. define(function() {
  2. return function install(Vue) {
  3. Vue.mixin({
  4. beforeCreate: function () {
  5. var self = this;
  6. if (this.$options.router) {
  7. Object.defineProperty(Vue.prototype, '$router', {
  8. get: function () {
  9. return self.$options.router;
  10. }
  11. });
  12. }
  13. }
  14. });
  15. };
  16. });