From 1f9e43b7bbb848c7ee2aaa89ffece17002b2c915 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 16 一月 2026 17:31:08 +0800
Subject: [PATCH] 2026.1.16
---
miniprogram_npm/tdesign-miniprogram/mixins/using-custom-navbar.js | 34 +---------------------------------
1 files changed, 1 insertions(+), 33 deletions(-)
diff --git a/miniprogram_npm/tdesign-miniprogram/mixins/using-custom-navbar.js b/miniprogram_npm/tdesign-miniprogram/mixins/using-custom-navbar.js
index a53a515..d455c92 100644
--- a/miniprogram_npm/tdesign-miniprogram/mixins/using-custom-navbar.js
+++ b/miniprogram_npm/tdesign-miniprogram/mixins/using-custom-navbar.js
@@ -1,33 +1 @@
-const useCustomNavbarBehavior = Behavior({
- properties: {
- usingCustomNavbar: {
- type: Boolean,
- value: false,
- },
- customNavbarHeight: {
- type: Number,
- value: 0,
- },
- },
- data: {
- distanceTop: 0,
- },
- lifetimes: {
- attached() {
- if (this.properties.usingCustomNavbar) {
- this.calculateCustomNavbarDistanceTop();
- }
- },
- },
- methods: {
- calculateCustomNavbarDistanceTop() {
- const { statusBarHeight } = wx.getSystemInfoSync();
- const menuButton = wx.getMenuButtonBoundingClientRect();
- const distance = menuButton.top + menuButton.bottom - statusBarHeight;
- this.setData({
- distanceTop: Math.max(distance, this.properties.customNavbarHeight + statusBarHeight),
- });
- },
- },
-});
-export default useCustomNavbarBehavior;
+import{systemInfo}from"../common/utils";const useCustomNavbarBehavior=Behavior({properties:{usingCustomNavbar:{type:Boolean,value:!1},customNavbarHeight:{type:Number,value:0}},data:{distanceTop:0},lifetimes:{attached(){this.properties.usingCustomNavbar&&this.calculateCustomNavbarDistanceTop()}},methods:{calculateCustomNavbarDistanceTop(){const{statusBarHeight:t}=systemInfo,a=wx.getMenuButtonBoundingClientRect(),e=a.top+a.bottom-t;this.setData({distanceTop:Math.max(e,this.properties.customNavbarHeight+t)})}}});export default useCustomNavbarBehavior;
\ No newline at end of file
--
Gitblit v1.9.3