From 041839b90131d3a4e6a5663986b811d60d4e6ba2 Mon Sep 17 00:00:00 2001 From: tanjinzhou <415800467@qq.com> Date: Tue, 22 Oct 2019 12:45:30 +0800 Subject: [PATCH] fix: throw error when use slot at template --- components/_util/props-util.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/_util/props-util.js b/components/_util/props-util.js index 0016073d87..f1d9a6b1f8 100644 --- a/components/_util/props-util.js +++ b/components/_util/props-util.js @@ -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 {