摘要: function mergeHook ( parentVal, childVal ) { var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [child 阅读全文
posted @ 2020-06-12 21:54 TTtttt5 阅读(203) 评论(0) 推荐(0) 编辑
摘要: function initMixin$1 (Vue) { Vue.mixin = function (mixin) { this.options = mergeOptions(this.options, mixin); return this }; } 可以传入Vue对象,然后需要调用的时候可以进行 阅读全文
posted @ 2020-06-12 12:41 TTtttt5 阅读(453) 评论(0) 推荐(0) 编辑
摘要: 源码中vue入口 function Vue (options) { if (!(this instanceof Vue) ) { warn('Vue is a constructor and should be called with the `new` keyword'); } this._ini 阅读全文
posted @ 2020-06-12 11:46 TTtttt5 阅读(799) 评论(0) 推荐(0) 编辑
摘要: //以web/entry-runtime.js为例子,base就是web,然后到aliases里去找里面刚好有web,就取到这个路径,再和剩余的/entry-runtime.js拼接,最终经过Rollup的构建打包,最终在dist目录下生成vue.runtime.common.js const al 阅读全文
posted @ 2020-06-12 10:22 TTtttt5 阅读(182) 评论(0) 推荐(0) 编辑
摘要: // filter builds via command line arg if (process.argv[2]) { //就是获取参数。process.argv[2] 就是获取参数是一个字符串,然后用split() 方法用于把一个字符串分割成字符串数组。 const filters = proc 阅读全文
posted @ 2020-06-12 09:47 TTtttt5 阅读(277) 评论(0) 推荐(0) 编辑
摘要: const isGeneratorFunction = require('is-generator-function'); const debug = require('debug')('koa:application'); /** * Use the given middleware `fn`. 阅读全文
posted @ 2020-06-12 07:10 TTtttt5 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 用reduce去遍历得出对象 阅读全文
posted @ 2020-06-12 07:02 TTtttt5 阅读(86) 评论(0) 推荐(0) 编辑
摘要: const http = require('http'); listen(...args) { debug('listen'); const server = http.createServer(this.callback()); return server.listen(...args); } c 阅读全文
posted @ 2020-06-12 06:55 TTtttt5 阅读(343) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-06-12 06:52 TTtttt5 阅读(76) 评论(0) 推荐(0) 编辑