first
This commit is contained in:
29
node_modules/vant/lib/mixins/slots.js
generated
vendored
Normal file
29
node_modules/vant/lib/mixins/slots.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.SlotsMixin = void 0;
|
||||
|
||||
/**
|
||||
* Use scopedSlots in Vue 2.6+
|
||||
* downgrade to slots in lower version
|
||||
*/
|
||||
var SlotsMixin = {
|
||||
methods: {
|
||||
slots: function slots(name, props) {
|
||||
if (name === void 0) {
|
||||
name = 'default';
|
||||
}
|
||||
|
||||
var $slots = this.$slots,
|
||||
$scopedSlots = this.$scopedSlots;
|
||||
var scopedSlot = $scopedSlots[name];
|
||||
|
||||
if (scopedSlot) {
|
||||
return scopedSlot(props);
|
||||
}
|
||||
|
||||
return $slots[name];
|
||||
}
|
||||
}
|
||||
};
|
||||
exports.SlotsMixin = SlotsMixin;
|
Reference in New Issue
Block a user