qidian-vue-ui 1.2.111 → 1.2.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- .qd-service-list[data-v-16157979] {
1
+ .qd-service-list[data-v-8b771c6e] {
2
2
  height: 100%;
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
  background-color: transparent;
6
6
  }
7
- .qd-service-list[data-v-16157979] > .t-list__load {
7
+ .qd-service-list[data-v-8b771c6e] > .t-list__load {
8
8
  color: var(--td-text-color-secondary);
9
9
  background-color: transparent;
10
10
  }
@@ -2,7 +2,7 @@ import './index.css'
2
2
  import _sfc_main from "./index.vue2.mjs";
3
3
  /* empty css */
4
4
  import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
5
- const QdServiceList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-16157979"]]);
5
+ const QdServiceList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8b771c6e"]]);
6
6
  export {
7
7
  QdServiceList as default
8
8
  };
@@ -1,5 +1,5 @@
1
1
  import './index.css'
2
- import { defineComponent, mergeDefaults, useTemplateRef, computed, onMounted, onActivated, onDeactivated, onBeforeUnmount, withDirectives, createBlock, openBlock, unref, mergeProps, createSlots, withCtx, renderSlot, createCommentVNode, createVNode, renderList, normalizeProps, guardReactiveProps } from "vue";
2
+ import { defineComponent, mergeDefaults, useTemplateRef, computed, nextTick, onMounted, onActivated, onDeactivated, onBeforeUnmount, withDirectives, createBlock, openBlock, unref, mergeProps, createSlots, withCtx, renderSlot, createCommentVNode, createVNode, renderList, normalizeProps, guardReactiveProps } from "vue";
3
3
  import { useVModels } from "../../../node_modules/.pnpm/@vueuse_core@14.2.0_vue@3.5.26_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.mjs";
4
4
  import { useServiceLoadMore, createExposeProxy, filterSlots } from "qidian-shared";
5
5
  import { List, Empty, LoadingDirective } from "tdesign-vue-next";
@@ -106,6 +106,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
106
106
  onSuccess: (res) => {
107
107
  reProps.value.serviceOptions.onSuccess?.(res);
108
108
  data.value = serviceData.value?.list || [];
109
+ autoFillIfShort();
109
110
  }
110
111
  });
111
112
  const empty = computed(() => noMore.value && !data.value.length);
@@ -149,6 +150,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
149
150
  if (typeof scrollTarget !== "string") return scrollTarget;
150
151
  return document.querySelector(scrollTarget);
151
152
  }
153
+ async function autoFillIfShort() {
154
+ await nextTick();
155
+ if (loading.value || loadingMore.value || noMore.value) return;
156
+ const el = getScrollTargetEl() || listRef.value?.$el;
157
+ if (!el) return;
158
+ const { scrollHeight, clientHeight } = el;
159
+ if (!clientHeight || scrollHeight > clientHeight) return;
160
+ loadMore();
161
+ }
152
162
  function onTargetScroll(evt) {
153
163
  const { scrollHeight, clientHeight, scrollTop } = evt.target;
154
164
  const scrollBottom = scrollHeight - clientHeight - scrollTop;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qidian-vue-ui",
3
- "version": "1.2.111",
3
+ "version": "1.2.112",
4
4
  "description": "基于 TDesign 的 QiDian Vue UI 组件库",
5
5
  "author": "qidian",
6
6
  "license": "MIT",