关于异步组件的cid问题
来源:3-13 异步组件(高级)

龙晓秀
2020-09-14
黄老师,您好!
在createComponent方法中会去判断isUndef(Ctor.cid)是否未定义,如果命中则当成异步组件去处理,但是
const baseCtor = context.$options._base
// plain options object: turn it into a constructor
if (isObject(Ctor)) {
Ctor = baseCtor.extend(Ctor)
}
我断点看工厂异步组件都会命中isObject(Ctor)这个判断,所以Ctor都会有cid,并没有走到isUndef(Ctor.cid)的判断中去调用resolveAsyncComponent方法创建异步组件,麻烦老师解答下 万分感谢
写回答
1回答
-
ustbhuangyi
2020-09-15
你的例子是怎么写的,传到 GitHub 上,我抽空帮你看看
042020-09-16
相似问题