Vue源码分析
2023-04-12 09:17:18 举报
AI智能生成
登录查看完整内容
相似推荐
查看更多
Vue知识总结
vue异步更新流程
MyBatis源码分析
Vue源码
vue源码
Mybatis源码分析
RocketMQ源码分析_草稿图
Vue源码模块分析
RocketMQ源码以及关键流程分析
vue源码分析
Vue源码分析
作者其他创作
大纲/内容
Vue学习
warn
extend
mergeOptions
defineReactive
util
set
delete
observable
directives
KeepAlive
components
filters
_base:Vue
options
use
mixin
directive
component
filter
super
superOptions
extendOptions
sealedOptions
Vue
initGlobalAPI
Vue.extend
$isServer
$ssrContext
version
_init
return this._data
$data
return this._props
$props
$set
$delete
$watch
$on
$once
$off
$emit
_update
$forceUpdate
$destroy
$nextTick
_render
Vue.property
initMixin
core/index.js
stateMixin
eventsMixin
lifecycleMixin
renderMixin
_uid
_isVue
经过编译添加render
$options
_self
$parent
$children
$root
$refs
_watcher
_inactive
_directInactive
_isMounted
_isDestroyed
_isBeingDestroyed
_events
_vnode
$slots
$scopedSlots
_c
$createElement
$attrs
$listeners
_props
_data
_computedWatchers
_watchers
_provided
$node
vm
initRender
initLifeCycle
initEvents
initState
initProvide
$mount
deep
user
lazy
sync
before
cb
dirty
deps
newDeps
depIds
newDepIds
Watcher
Vnode
Dep
先找render
template是html的模版
template写的是#id
template写的是获取好的某个节点:document.querySelector
再找template
最后才找el
createCompiler = createCompilerCreator(font color=\"#000000\
function createCompilerCreator(baseCompile){ return function createCompiler(baseOptions){ function font color=\"#000000\
function createCompileToFunctionFn(compile){ return function font color=\"#000000\
给options添加render
expectHTML:true
staticKeys:['staticClass']
transformNode
genData
klass
staticKeys:['staticStyle']
style
preTransformNode
model
modules
text
html
tag==='pre'
isPreTag
可以单闭合标签
isUnaryTag
mustUseProp
canBeLeftOpenTag
html相关
svg相关
isReservedTag
getTagNamespace
把modlules中的staticKeys包含在一块儿
staticKeys:genStaticKeys(modules)
baseOptions
对象res都会通过extend的形式添加到el上
processFor
v-else: el.else = true
v-else-if: el.elseif = elseif-exp
processIf
v-once: el.once=true
processOnce
el.ref=refexp
循环检查父元素在不在for里,有一个在即在
el.refInFor
processRef
<template scope=\"xxx\
el.slotTargetel.slotTargetDynamic
processSlotContent
el.slotName=exp
processSlotOutlet
el.is = exp
el.inlineTemplate
processComponent
el.directives:{name:{}}
processAttrs
processElement
匹配开始标签:处理属性
匹配结束标签:处理父子关系,v-if等关系
parseHTML
parse
optimize
_m
genstatic
_o
genOnce
(exp){return}
genIf
genChildren
genSlot
genComponent
generate
编译
0 条评论
回复 删除
下一页