vant/packages/utils/slots.js
2019-02-01 17:10:31 +08:00

9 lines
189 B
JavaScript

export function useSlots({ $slots, $scopedSlots }) {
return (name, props) => {
if ($scopedSlots[name]) {
return $scopedSlots[name](props);
}
return $slots[name];
};
}