1
0
mirror of https://gitee.com/vant-contrib/vant.git synced 2025-04-06 03:57:59 +08:00
2019-02-19 16:04:29 +08:00

17 lines
324 B
JavaScript

/**
* Use scopedSlots in Vue 2.6+
* downgrade to slots in lower version
*/
export const SlotsMixin = {
methods: {
slots(name = 'default', props) {
const { $slots, $scopedSlots } = this;
if ($scopedSlots[name]) {
return $scopedSlots[name](props);
}
return $slots[name];
}
}
};