优化页面
This commit is contained in:
77
unpackage/dist/dev/mp-weixin/TUIKit/components/common/FetchMore/index.js
vendored
Normal file
77
unpackage/dist/dev/mp-weixin/TUIKit/components/common/FetchMore/index.js
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
require("../../../adapter-vue.js");
|
||||
const TUIKit_utils_env = require("../../../utils/env.js");
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "index",
|
||||
props: {
|
||||
isFetching: { type: Boolean, default: false },
|
||||
isTerminateObserve: { type: Boolean, default: false }
|
||||
},
|
||||
emits: ["onExposed"],
|
||||
setup(__props, { emit: __emit }) {
|
||||
var _a;
|
||||
const emits = __emit;
|
||||
const props = __props;
|
||||
let observer = null;
|
||||
const selfDomRef = common_vendor.ref();
|
||||
const thisInstance = ((_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.proxy) || common_vendor.getCurrentInstance();
|
||||
common_vendor.onMounted(() => {
|
||||
if (props.isTerminateObserve) {
|
||||
return;
|
||||
}
|
||||
if (!TUIKit_utils_env.isUniFrameWork) {
|
||||
observer = new IntersectionObserver(([entry]) => {
|
||||
if (entry.isIntersecting) {
|
||||
emits("onExposed");
|
||||
}
|
||||
}, {
|
||||
threshold: 1
|
||||
});
|
||||
if (selfDomRef.value) {
|
||||
observer.observe(selfDomRef.value);
|
||||
}
|
||||
} else {
|
||||
observer = common_vendor.index.createIntersectionObserver(thisInstance).relativeToViewport();
|
||||
observer.observe(".fetch-more-block", () => {
|
||||
emits("onExposed");
|
||||
});
|
||||
}
|
||||
});
|
||||
common_vendor.onUnmounted(() => {
|
||||
if (observer) {
|
||||
observer.disconnect();
|
||||
observer = null;
|
||||
}
|
||||
});
|
||||
common_vendor.watch(() => props.isTerminateObserve, (isTerminateObserve) => {
|
||||
if (!observer) {
|
||||
return;
|
||||
}
|
||||
if (isTerminateObserve) {
|
||||
observer.disconnect();
|
||||
} else if (selfDomRef.value) {
|
||||
observer.disconnect();
|
||||
if (!TUIKit_utils_env.isUniFrameWork) {
|
||||
observer.observe(selfDomRef.value);
|
||||
} else {
|
||||
observer.observe(".fetch-more-block", () => {
|
||||
emits("onExposed");
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: props.isFetching
|
||||
}, props.isFetching ? {
|
||||
b: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("TUIChat.正在加载"))
|
||||
} : {
|
||||
c: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("TUIChat.加载结束"))
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-ab2918f1"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/TUIKit/components/common/FetchMore/index.js.map
|
||||
4
unpackage/dist/dev/mp-weixin/TUIKit/components/common/FetchMore/index.json
vendored
Normal file
4
unpackage/dist/dev/mp-weixin/TUIKit/components/common/FetchMore/index.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/TUIKit/components/common/FetchMore/index.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/TUIKit/components/common/FetchMore/index.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view ref="selfDomRef" class="fetch-more-block data-v-ab2918f1"><block wx:if="{{a}}"><block wx:if="{{$slots.fetching}}"><slot name="fetching"></slot></block><block wx:else><view class="data-v-ab2918f1">{{b}}</view></block></block><block wx:else><block wx:if="{{$slots.fetchEnd}}"><slot name="fetchEnd"></slot></block><block wx:else><view class="data-v-ab2918f1">{{c}}</view></block></block></view>
|
||||
28
unpackage/dist/dev/mp-weixin/TUIKit/components/common/FetchMore/index.wxss
vendored
Normal file
28
unpackage/dist/dev/mp-weixin/TUIKit/components/common/FetchMore/index.wxss
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.fetch-more-block.data-v-ab2918f1 {
|
||||
color: #999;
|
||||
}
|
||||
Reference in New Issue
Block a user