Skip to content

Commit 041839b

Browse files
committed
fix: throw error when use slot at template
1 parent 600f2db commit 041839b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/_util/props-util.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ const getComponentFromProp = (instance, prop, options = instance, execute = true
137137
const componentOptions = instance.componentOptions || {};
138138
(componentOptions.children || []).forEach(child => {
139139
if (child.data && child.data.slot === prop) {
140-
delete child.data.attrs.slot;
140+
if (child.data.attrs) {
141+
delete child.data.attrs.slot;
142+
}
141143
if (child.tag === 'template') {
142144
slotsProp.push(child.children);
143145
} else {

0 commit comments

Comments
 (0)