Files
2018-12-12 10:07:50 +08:00

8 lines
259 B
JavaScript

module.exports = function slotsToCode (map) {
return Object.keys(map)
.map((slotKey, index) => {
return `<template ${index === 0 ? 'v-if' : 'v-else-if'}="$parent.slotKey === '${slotKey}' ">` + map[slotKey] + `</template>`
})
.join('\n')
}