# vue源码 动态组件
# component 标签
processComponent
增加is
标签- is 是导入的组件!
<component
:is="currentTab">
</component>
import ManuaBill from './manualBill'
....
data() {
return {
currentTab: ManuaBill,
}
}
# 源码
function processComponent (el) {
let binding
if ((binding = getBindingAttr(el, 'is'))) {
el.component = binding
}
if (getAndRemoveAttr(el, 'inline-template') != null) {
el.inlineTemplate = true
}
}
...