fix: throw error when use slot at template

pull/1391/head 1.4.3
tanjinzhou 2019-10-22 12:45:30 +08:00
parent 600f2db48a
commit 041839b901
1 changed files with 3 additions and 1 deletions

View File

@ -137,7 +137,9 @@ const getComponentFromProp = (instance, prop, options = instance, execute = true
const componentOptions = instance.componentOptions || {};
(componentOptions.children || []).forEach(child => {
if (child.data && child.data.slot === prop) {
delete child.data.attrs.slot;
if (child.data.attrs) {
delete child.data.attrs.slot;
}
if (child.tag === 'template') {
slotsProp.push(child.children);
} else {