31 lines
1.2 KiB
JavaScript
31 lines
1.2 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
__name: "hs-scroll-indicator",
|
|
props: ["scroll_view"],
|
|
setup(__props) {
|
|
const props = __props;
|
|
let getWindowInfo = common_vendor.index.getWindowInfo();
|
|
const scroll_left = common_vendor.ref(0);
|
|
common_vendor.watch(
|
|
() => {
|
|
var _a;
|
|
return (_a = props == null ? void 0 : props.scroll_view) == null ? void 0 : _a.scrollLeft;
|
|
},
|
|
(e) => {
|
|
let res = props == null ? void 0 : props.scroll_view;
|
|
let maxScrollLeft = (res == null ? void 0 : res.scrollWidth) - (getWindowInfo == null ? void 0 : getWindowInfo.windowWidth);
|
|
let scrollPercentage = (res == null ? void 0 : res.scrollLeft) / maxScrollLeft * 100;
|
|
scroll_left.value = scrollPercentage / 100 * 25;
|
|
}
|
|
);
|
|
return (_ctx, _cache) => {
|
|
return {
|
|
a: `${scroll_left.value}%`
|
|
};
|
|
};
|
|
}
|
|
});
|
|
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b1b33646"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-employee/src/components/hs-scroll-indicator/hs-scroll-indicator.vue"]]);
|
|
wx.createComponent(Component);
|