Skip to content

Commit b339d98

Browse files
committed
fix: prevent error on empty slot
1 parent 32b95bb commit b339d98

4 files changed

+23
-31
lines changed

dist/vue-infinite-loading.esm.js

+8-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineComponent, pushScopeId, popScopeId, openBlock, createElementBlock, Fragment, renderList, createElementVNode, createCommentVNode, Text, resolveComponent, withDirectives, normalizeStyle, renderSlot, normalizeProps, guardReactiveProps, createVNode, vShow, createBlock, resolveDynamicComponent, createTextVNode, toDisplayString } from 'vue';
1+
import { defineComponent, openBlock, createElementBlock, Fragment, renderList, createElementVNode, createCommentVNode, Text, resolveComponent, withDirectives, normalizeStyle, renderSlot, normalizeProps, guardReactiveProps, createVNode, vShow, createBlock, resolveDynamicComponent, createTextVNode, toDisplayString, pushScopeId, popScopeId } from 'vue';
22

33
function E () {
44
// Keep this empty so it's easier to inherit from
@@ -91,8 +91,6 @@ var script$1 = /* #__PURE__ */defineComponent({
9191
}
9292
});
9393

94-
pushScopeId("data-v-18ae5a62");
95-
9694
const _hoisted_1$1 = {
9795
key: 0,
9896
class: "loading-default"
@@ -113,9 +111,6 @@ const _hoisted_5 = {
113111
key: 4,
114112
class: "loading-wave-dots"
115113
};
116-
117-
popScopeId();
118-
119114
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
120115
return _ctx.spinnerView === 'default' ? (openBlock(), createElementBlock("i", _hoisted_1$1)) : _ctx.spinnerView === 'bubbles' ? (openBlock(), createElementBlock("span", _hoisted_2$1, [(openBlock(), createElementBlock(Fragment, null, renderList(8, x => {
121116
return createElementVNode("span", {
@@ -443,10 +438,12 @@ var script = /* #__PURE__ */defineComponent({
443438
slotStyles() {
444439
const styles = {};
445440
Object.keys(config.slots).forEach(key => {
441+
var _this$$slots$name$;
442+
446443
const name = kebabCase(key);
447444

448445
if ( // no slot and the configured default slot is not a Vue component
449-
!this.$slots[name] && !config.slots[key].render || this.$slots[name] && this.$slots[name]()[0].type === Text) {
446+
!this.$slots[name] && !config.slots[key].render || this.$slots[name] && ((_this$$slots$name$ = this.$slots[name]()[0]) === null || _this$$slots$name$ === void 0 ? void 0 : _this$$slots$name$.type) === Text) {
450447
// only apply default styles for pure text slot
451448
styles[key] = SLOT_STYLES;
452449
} else {
@@ -682,18 +679,15 @@ var script = /* #__PURE__ */defineComponent({
682679

683680
});
684681

685-
pushScopeId("data-v-7456bf16");
682+
const _withScopeId = n => (pushScopeId("data-v-38327aa8"), n = n(), popScopeId(), n);
686683

687684
const _hoisted_1 = {
688685
class: "infinite-loading-container"
689686
};
690687

691-
const _hoisted_2 = /*#__PURE__*/createElementVNode("br", null, null, -1);
688+
const _hoisted_2 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/createElementVNode("br", null, null, -1));
692689

693690
const _hoisted_3 = ["textContent"];
694-
695-
popScopeId();
696-
697691
function render(_ctx, _cache, $props, $setup, $data, $options) {
698692
const _component_spinner = resolveComponent("spinner");
699693

@@ -735,11 +729,11 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
735729
}, null, 8, _hoisted_3)], 64))])], 4), [[vShow, _ctx.isShowError]])]);
736730
}
737731

738-
var css_248z = ".infinite-loading-container[data-v-7456bf16] {\n clear: both;\n text-align: center;\n}\n.infinite-loading-container[data-v-7456bf16] *[class^=loading-] {\n display: inline-block;\n margin: 5px 0;\n width: 28px;\n height: 28px;\n font-size: 28px;\n line-height: 28px;\n border-radius: 50%;\n}\n.btn-try-infinite[data-v-7456bf16] {\n margin-top: 5px;\n padding: 5px 10px;\n color: #999;\n font-size: 14px;\n line-height: 1;\n background: transparent;\n border: 1px solid #ccc;\n border-radius: 3px;\n outline: none;\n cursor: pointer;\n}\n.btn-try-infinite[data-v-7456bf16]:not(:active):hover {\n opacity: 0.8;\n}\n";
732+
var css_248z = ".infinite-loading-container[data-v-38327aa8] {\n clear: both;\n text-align: center;\n}\n.infinite-loading-container[data-v-38327aa8] *[class^=loading-] {\n display: inline-block;\n margin: 5px 0;\n width: 28px;\n height: 28px;\n font-size: 28px;\n line-height: 28px;\n border-radius: 50%;\n}\n.btn-try-infinite[data-v-38327aa8] {\n margin-top: 5px;\n padding: 5px 10px;\n color: #999;\n font-size: 14px;\n line-height: 1;\n background: transparent;\n border: 1px solid #ccc;\n border-radius: 3px;\n outline: none;\n cursor: pointer;\n}\n.btn-try-infinite[data-v-38327aa8]:not(:active):hover {\n opacity: 0.8;\n}\n";
739733
styleInject(css_248z);
740734

741735
script.render = render;
742-
script.__scopeId = "data-v-7456bf16";
736+
script.__scopeId = "data-v-38327aa8";
743737

744738
// Import vue component
745739
// IIFE injects install function into component, allowing component

0 commit comments

Comments
 (0)