32 lines
1.3 KiB
JavaScript
32 lines
1.3 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
__name: "hs-custom-title",
|
|
props: ["title", "objStyle"],
|
|
setup(__props) {
|
|
const props = __props;
|
|
const titleValue = common_vendor.ref("标题");
|
|
const capsuleRect = common_vendor.ref({});
|
|
common_vendor.watch(
|
|
() => props.title,
|
|
(newVal) => {
|
|
titleValue.value = newVal;
|
|
console.log(newVal, "title");
|
|
}
|
|
);
|
|
common_vendor.onMounted(() => {
|
|
titleValue.value = props.title;
|
|
capsuleRect.value = common_vendor.index.getMenuButtonBoundingClientRect();
|
|
console.log(capsuleRect.value, "capsuleRect");
|
|
});
|
|
return (_ctx, _cache) => {
|
|
return {
|
|
a: common_vendor.t(titleValue.value || "标题"),
|
|
b: common_vendor.s(`padding-top:${capsuleRect.value.top}px;height:${capsuleRect.value.height}px;line-height:${capsuleRect.value.height}px;${props == null ? void 0 : props.objStyle}`)
|
|
};
|
|
};
|
|
}
|
|
});
|
|
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4e15f08c"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-customer/src/components/hs-custom-title/hs-custom-title.vue"]]);
|
|
wx.createComponent(Component);
|