1234567891011121314151617181920 |
- class MyArray extends Array {
- constructor(Router, vueOldHooks, hookFun) {
- super();
- this.Router = Router;
- this.vueOldHooks = vueOldHooks;
- this.hookFun = hookFun;
- }
- push(v) {
- this.vueOldHooks.splice(0, 1, v);
- this[this.length] = (to, from, next) => {
- this.hookFun(to, from, next, this.Router);
- };
- }
- }
- export default MyArray;
|