mirror of
https://github.com/wahyd4/vuepress.git
synced 2026-08-13 15:25:51 +10:00
8 lines
259 B
JavaScript
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')
|
|
}
|