11 lines
313 B
JavaScript
Raw Normal View History

2024-01-29 09:26:07 +08:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
2024-08-02 18:19:39 +08:00
exports.getSlot = getSlot;
2024-01-29 09:26:07 +08:00
function getSlot(instance, slotName = 'default', fallback = []) {
const slots = instance.$slots;
const slot = slots[slotName];
if (slot === undefined)
return fallback;
return slot();
}