图片授权基于 www.pixabay.com 相关协议
自从上次发完文章《如何调试 Vue 源码》后,关于 Vue 的文章就基本断更了,我想再梳理一下源码里面的东西。
\\\"dev\\\": \\\"rollup -w -c scripts/config.js --environment TARGET:web-full-dev\\\"
{
entry: resolve(\\\'web/entry-runtime-with-compiler.js\\\'),
dest: resolve(\\\'dist/vue.js\\\'),
format: \\\'umd\\\',
env: \\\'development\\\',
alias: { he: \\\'./entity-decoder\\\' },
banner
}
web: resolve(\\\'src/platforms/web\\\')
import Vue from \\\'./runtime/index\\\'//继续查找文件的源头
import Vue from \\\'core/index\\\'//继续查找文件的源头
import Vue from \\\'./instance/index\\\'
import { initMixin } from \\\'./init\\\'
import { stateMixin } from \\\'./state\\\'
import { renderMixin } from \\\'./render\\\'
import { eventsMixin } from \\\'./events\\\'
import { lifecycleMixin } from \\\'./lifecycle\\\'
import { warn } from \\\'../util/index\\\'
function Vue (options) {
if (process.env.NODE_ENV !== \\\'production\\\' && !(this instanceof Vue) ) {
warn(\\\'Vue is a constructor and should be called with the `new` keyword\\\')
}
this._init(options)
}
initMixin(Vue)
stateMixin(Vue)
eventsMixin(Vue)
lifecycleMixin(Vue)
renderMixin(Vue)
export default Vue
initMixin(Vue)
Vue.prototype._init = function (options?: Object) {}
this._init(options)
new Vue({
el:\\\"#demo\\\",
data(){
return{
message:\\\"I\\\'m a message.\\\"
}
}
})
initLifecycle(vm)
initEvents(vm)
initRender(vm)
callHook(vm, \\\'beforeCreate\\\')
initInjections(vm) // resolve injections before data/props
initState(vm)
initProvide(vm) // resolve provide after data/props
callHook(vm, \\\'created\\\')
推荐阅读
HTTP 协议的请求头和响应头
原创文章,作者:小道研究,如若转载,请注明出处:https://www.sudun.com/ask/34581.html