|
|
@ -501,7 +501,14 @@ function genSlot (el: ASTElement, state: CodegenState): string { |
|
|
|
const slotName = el.slotName || '"default"' |
|
|
|
const children = genChildren(el, state) |
|
|
|
let res = `_t(${slotName}${children ? `,${children}` : ''}` |
|
|
|
const attrs = el.attrs && `{${el.attrs.map(a => `${camelize(a.name)}:${a.value}`).join(',')}}` |
|
|
|
const attrs = el.attrs || el.dynamicAttrs |
|
|
|
? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(attr => ({ |
|
|
|
// slot props are camelized
|
|
|
|
name: camelize(attr.name), |
|
|
|
value: attr.value, |
|
|
|
dynamic: attr.dynamic |
|
|
|
}))) |
|
|
|
: null |
|
|
|
const bind = el.attrsMap['v-bind'] |
|
|
|
if ((attrs || bind) && !children) { |
|
|
|
res += `,null` |
|
|
|