@weitutech/by-components 1.1.102 → 1.1.104

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.
@@ -79022,8 +79022,8 @@ var ByCascaderPanel_component = normalizeComponent(
79022
79022
  )
79023
79023
 
79024
79024
  /* harmony default export */ var ByCascaderPanel = (ByCascaderPanel_component.exports);
79025
- ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"ffbc40de-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/floating-menu/ByFloatingMenu.vue?vue&type=template&id=08613879
79026
- var ByFloatingMenuvue_type_template_id_08613879_render = function render() {
79025
+ ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"ffbc40de-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/floating-menu/ByFloatingMenu.vue?vue&type=template&id=365e7526
79026
+ var ByFloatingMenuvue_type_template_id_365e7526_render = function render() {
79027
79027
  var _vm = this,
79028
79028
  _c = _vm._self._c;
79029
79029
  return _c('div', {
@@ -79148,7 +79148,7 @@ var ByFloatingMenuvue_type_template_id_08613879_render = function render() {
79148
79148
  }, [_vm._v(_vm._s(item.text))])]);
79149
79149
  }), 0)])], 1);
79150
79150
  };
79151
- var ByFloatingMenuvue_type_template_id_08613879_staticRenderFns = [];
79151
+ var ByFloatingMenuvue_type_template_id_365e7526_staticRenderFns = [];
79152
79152
 
79153
79153
  ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/floating-menu/ByFloatingMenu.vue?vue&type=script&lang=js
79154
79154
  /* harmony default export */ var ByFloatingMenuvue_type_script_lang_js = ({
@@ -79185,6 +79185,14 @@ var ByFloatingMenuvue_type_template_id_08613879_staticRenderFns = [];
79185
79185
  }
79186
79186
  },
79187
79187
  data() {
79188
+ // 在 data 中初始化位置,避免渲染时的位置跳动
79189
+ const {
79190
+ right,
79191
+ bottom
79192
+ } = this.position;
79193
+ const windowHeight = typeof window !== 'undefined' ? window.innerHeight : 800;
79194
+ const bottomValue = parseInt(bottom) || 20;
79195
+ const mainButtonSize = this.getMainButtonSize();
79188
79196
  return {
79189
79197
  isExpanded: false,
79190
79198
  isHidden: false,
@@ -79196,9 +79204,12 @@ var ByFloatingMenuvue_type_template_id_08613879_staticRenderFns = [];
79196
79204
  },
79197
79205
  currentPosition: {
79198
79206
  x: 0,
79199
- y: 0
79207
+ y: windowHeight - bottomValue - mainButtonSize
79208
+ },
79209
+ menuStyle: {
79210
+ right: right,
79211
+ bottom: bottom
79200
79212
  },
79201
- menuStyle: {},
79202
79213
  // 菜单项拖动相关
79203
79214
  menuItemDragStart: {
79204
79215
  x: 0,
@@ -79211,16 +79222,12 @@ var ByFloatingMenuvue_type_template_id_08613879_staticRenderFns = [];
79211
79222
  computed: {
79212
79223
  // 根据size属性计算实际大小
79213
79224
  mainButtonSize() {
79214
- const sizeMap = {
79215
- mini: 40,
79216
- small: 50,
79217
- medium: 60
79218
- };
79219
- return sizeMap[this.size] || 50;
79225
+ return this.getMainButtonSize();
79220
79226
  }
79221
79227
  },
79222
79228
  mounted() {
79223
- this.initPosition();
79229
+ // 位置已在 data 中初始化,这里只需要重新计算以确保准确性
79230
+ this.refreshPosition();
79224
79231
  this.bindEvents();
79225
79232
  this.bindPageEvents();
79226
79233
  },
@@ -79233,23 +79240,35 @@ var ByFloatingMenuvue_type_template_id_08613879_staticRenderFns = [];
79233
79240
  document.removeEventListener('mouseup', this.endMenuItemDrag);
79234
79241
  },
79235
79242
  methods: {
79236
- // 初始化位置
79237
- initPosition() {
79243
+ // 获取主按钮大小的辅助方法
79244
+ getMainButtonSize() {
79245
+ const sizeMap = {
79246
+ mini: 40,
79247
+ small: 50,
79248
+ medium: 60
79249
+ };
79250
+ return sizeMap[this.size] || 50;
79251
+ },
79252
+ // 刷新位置(在 mounted 时重新计算以确保准确性)
79253
+ refreshPosition() {
79238
79254
  const {
79239
79255
  right,
79240
79256
  bottom
79241
79257
  } = this.position;
79258
+ const windowHeight = window.innerHeight;
79259
+ const bottomValue = parseInt(bottom) || 20;
79260
+
79261
+ // 更新菜单样式
79242
79262
  this.menuStyle = {
79263
+ ...this.menuStyle,
79243
79264
  right: right,
79244
79265
  bottom: bottom
79245
79266
  };
79246
79267
 
79247
- // 初始化当前位置
79248
- const windowHeight = window.innerHeight;
79249
- const bottomValue = parseInt(bottom) || 20;
79268
+ // 更新当前位置
79250
79269
  this.currentPosition = {
79251
79270
  x: 0,
79252
- y: windowHeight - bottomValue - this.mainButtonSize // 使用动态主按钮大小
79271
+ y: windowHeight - bottomValue - this.mainButtonSize
79253
79272
  };
79254
79273
  },
79255
79274
  // 切换菜单展开状态
@@ -79273,10 +79292,8 @@ var ByFloatingMenuvue_type_template_id_08613879_staticRenderFns = [];
79273
79292
  transition: 'right 0.3s ease',
79274
79293
  opacity: '0'
79275
79294
  };
79276
- // 只有在页面可见时才创建显示按钮
79277
- if (!document.hidden) {
79278
- this.createShowButton();
79279
- }
79295
+ // 创建显示按钮,使用当前纵向位置
79296
+ this.createShowButton();
79280
79297
  } else {
79281
79298
  // 显示主菜单,保持当前位置
79282
79299
  this.menuStyle = {
@@ -79419,50 +79436,11 @@ var ByFloatingMenuvue_type_template_id_08613879_staticRenderFns = [];
79419
79436
  document.removeEventListener('mousemove', this.onDrag);
79420
79437
  document.removeEventListener('mouseup', this.endDrag);
79421
79438
  },
79422
- // 绑定页面相关事件
79423
- bindPageEvents() {
79424
- // 监听页面可见性变化(切换 tab)
79425
- document.addEventListener('visibilitychange', this.onVisibilityChange);
79426
-
79427
- // 监听页面卸载事件
79428
- window.addEventListener('beforeunload', this.onPageUnload);
79429
-
79430
- // 监听路由变化(如果使用了 Vue Router)
79431
- if (this.$router) {
79432
- this.$router.beforeEach((to, from, next) => {
79433
- // 在路由切换前移除显示按钮
79434
- this.removeShowButton();
79435
- next();
79436
- });
79437
- }
79438
- },
79439
- // 解绑页面相关事件
79440
- unbindPageEvents() {
79441
- document.removeEventListener('visibilitychange', this.onVisibilityChange);
79442
- window.removeEventListener('beforeunload', this.onPageUnload);
79443
- },
79444
- // 页面可见性变化处理
79445
- onVisibilityChange() {
79446
- if (document.hidden) {
79447
- // 页面变为隐藏状态(切换 tab 或最小化),移除显示按钮
79448
- this.removeShowButton();
79449
- }
79450
- },
79451
- // 页面卸载处理
79452
- onPageUnload() {
79453
- // 页面卸载前移除显示按钮
79454
- this.removeShowButton();
79455
- },
79456
79439
  // 创建显示按钮
79457
79440
  createShowButton() {
79458
79441
  // 先移除可能存在的显示按钮
79459
79442
  this.removeShowButton();
79460
79443
 
79461
- // 如果页面不可见,不创建显示按钮
79462
- if (document.hidden) {
79463
- return;
79464
- }
79465
-
79466
79444
  // 计算当前主按钮的纵向位置
79467
79445
  let topPosition = '50%';
79468
79446
  if (this.menuStyle.top) {
@@ -79539,6 +79517,88 @@ var ByFloatingMenuvue_type_template_id_08613879_staticRenderFns = [];
79539
79517
  if (showBtn) {
79540
79518
  showBtn.remove();
79541
79519
  }
79520
+ },
79521
+ // ========== 外部调用方法 ==========
79522
+
79523
+ // 显示悬浮菜单
79524
+ show() {
79525
+ if (this.isHidden) {
79526
+ this.isHidden = false;
79527
+ this.isExpanded = false;
79528
+
79529
+ // 显示主菜单,保持当前位置
79530
+ this.menuStyle = {
79531
+ ...this.menuStyle,
79532
+ right: '20px',
79533
+ transition: 'right 0.3s ease, opacity 0.3s ease',
79534
+ opacity: '1'
79535
+ };
79536
+ // 移除显示按钮
79537
+ this.removeShowButton();
79538
+ }
79539
+ },
79540
+ // 隐藏悬浮菜单
79541
+ hide() {
79542
+ if (!this.isHidden) {
79543
+ this.isHidden = true;
79544
+ this.isExpanded = false;
79545
+
79546
+ // 保持当前纵向位置,只隐藏横向
79547
+ this.menuStyle = {
79548
+ ...this.menuStyle,
79549
+ right: '-100px',
79550
+ transition: 'right 0.3s ease',
79551
+ opacity: '0'
79552
+ };
79553
+ // 移除显示按钮
79554
+ this.removeShowButton();
79555
+ }
79556
+ },
79557
+ // 完全移除显示按钮(用于页面切换时清理)
79558
+ removeShowButtonOnly() {
79559
+ this.removeShowButton();
79560
+ },
79561
+ // 获取当前隐藏状态
79562
+ getHiddenState() {
79563
+ return this.isHidden;
79564
+ },
79565
+ // 切换显示/隐藏状态
79566
+ toggle() {
79567
+ this.toggleHide();
79568
+ },
79569
+ // 绑定页面相关事件
79570
+ bindPageEvents() {
79571
+ // 监听页面可见性变化(切换 tab)
79572
+ document.addEventListener('visibilitychange', this.onVisibilityChange);
79573
+
79574
+ // 监听页面卸载事件
79575
+ window.addEventListener('beforeunload', this.onPageUnload);
79576
+
79577
+ // 监听路由变化(如果使用了 Vue Router)
79578
+ if (this.$router) {
79579
+ this.$router.beforeEach((to, from, next) => {
79580
+ // 在路由切换前移除显示按钮
79581
+ this.removeShowButton();
79582
+ next();
79583
+ });
79584
+ }
79585
+ },
79586
+ // 解绑页面相关事件
79587
+ unbindPageEvents() {
79588
+ document.removeEventListener('visibilitychange', this.onVisibilityChange);
79589
+ window.removeEventListener('beforeunload', this.onPageUnload);
79590
+ },
79591
+ // 页面可见性变化处理
79592
+ onVisibilityChange() {
79593
+ if (document.hidden) {
79594
+ // 页面变为隐藏状态(切换 tab 或最小化),移除显示按钮
79595
+ this.removeShowButton();
79596
+ }
79597
+ },
79598
+ // 页面卸载处理
79599
+ onPageUnload() {
79600
+ // 页面卸载前移除显示按钮
79601
+ this.removeShowButton();
79542
79602
  }
79543
79603
  }
79544
79604
  });
@@ -79554,8 +79614,8 @@ var ByFloatingMenuvue_type_template_id_08613879_staticRenderFns = [];
79554
79614
  ;
79555
79615
  var ByFloatingMenu_component = normalizeComponent(
79556
79616
  floating_menu_ByFloatingMenuvue_type_script_lang_js,
79557
- ByFloatingMenuvue_type_template_id_08613879_render,
79558
- ByFloatingMenuvue_type_template_id_08613879_staticRenderFns,
79617
+ ByFloatingMenuvue_type_template_id_365e7526_render,
79618
+ ByFloatingMenuvue_type_template_id_365e7526_staticRenderFns,
79559
79619
  false,
79560
79620
  null,
79561
79621
  null,
@@ -79032,8 +79032,8 @@ var ByCascaderPanel_component = normalizeComponent(
79032
79032
  )
79033
79033
 
79034
79034
  /* harmony default export */ var ByCascaderPanel = (ByCascaderPanel_component.exports);
79035
- ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"ffbc40de-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/floating-menu/ByFloatingMenu.vue?vue&type=template&id=08613879
79036
- var ByFloatingMenuvue_type_template_id_08613879_render = function render() {
79035
+ ;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"ffbc40de-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/floating-menu/ByFloatingMenu.vue?vue&type=template&id=365e7526
79036
+ var ByFloatingMenuvue_type_template_id_365e7526_render = function render() {
79037
79037
  var _vm = this,
79038
79038
  _c = _vm._self._c;
79039
79039
  return _c('div', {
@@ -79158,7 +79158,7 @@ var ByFloatingMenuvue_type_template_id_08613879_render = function render() {
79158
79158
  }, [_vm._v(_vm._s(item.text))])]);
79159
79159
  }), 0)])], 1);
79160
79160
  };
79161
- var ByFloatingMenuvue_type_template_id_08613879_staticRenderFns = [];
79161
+ var ByFloatingMenuvue_type_template_id_365e7526_staticRenderFns = [];
79162
79162
 
79163
79163
  ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/floating-menu/ByFloatingMenu.vue?vue&type=script&lang=js
79164
79164
  /* harmony default export */ var ByFloatingMenuvue_type_script_lang_js = ({
@@ -79195,6 +79195,14 @@ var ByFloatingMenuvue_type_template_id_08613879_staticRenderFns = [];
79195
79195
  }
79196
79196
  },
79197
79197
  data() {
79198
+ // 在 data 中初始化位置,避免渲染时的位置跳动
79199
+ const {
79200
+ right,
79201
+ bottom
79202
+ } = this.position;
79203
+ const windowHeight = typeof window !== 'undefined' ? window.innerHeight : 800;
79204
+ const bottomValue = parseInt(bottom) || 20;
79205
+ const mainButtonSize = this.getMainButtonSize();
79198
79206
  return {
79199
79207
  isExpanded: false,
79200
79208
  isHidden: false,
@@ -79206,9 +79214,12 @@ var ByFloatingMenuvue_type_template_id_08613879_staticRenderFns = [];
79206
79214
  },
79207
79215
  currentPosition: {
79208
79216
  x: 0,
79209
- y: 0
79217
+ y: windowHeight - bottomValue - mainButtonSize
79218
+ },
79219
+ menuStyle: {
79220
+ right: right,
79221
+ bottom: bottom
79210
79222
  },
79211
- menuStyle: {},
79212
79223
  // 菜单项拖动相关
79213
79224
  menuItemDragStart: {
79214
79225
  x: 0,
@@ -79221,16 +79232,12 @@ var ByFloatingMenuvue_type_template_id_08613879_staticRenderFns = [];
79221
79232
  computed: {
79222
79233
  // 根据size属性计算实际大小
79223
79234
  mainButtonSize() {
79224
- const sizeMap = {
79225
- mini: 40,
79226
- small: 50,
79227
- medium: 60
79228
- };
79229
- return sizeMap[this.size] || 50;
79235
+ return this.getMainButtonSize();
79230
79236
  }
79231
79237
  },
79232
79238
  mounted() {
79233
- this.initPosition();
79239
+ // 位置已在 data 中初始化,这里只需要重新计算以确保准确性
79240
+ this.refreshPosition();
79234
79241
  this.bindEvents();
79235
79242
  this.bindPageEvents();
79236
79243
  },
@@ -79243,23 +79250,35 @@ var ByFloatingMenuvue_type_template_id_08613879_staticRenderFns = [];
79243
79250
  document.removeEventListener('mouseup', this.endMenuItemDrag);
79244
79251
  },
79245
79252
  methods: {
79246
- // 初始化位置
79247
- initPosition() {
79253
+ // 获取主按钮大小的辅助方法
79254
+ getMainButtonSize() {
79255
+ const sizeMap = {
79256
+ mini: 40,
79257
+ small: 50,
79258
+ medium: 60
79259
+ };
79260
+ return sizeMap[this.size] || 50;
79261
+ },
79262
+ // 刷新位置(在 mounted 时重新计算以确保准确性)
79263
+ refreshPosition() {
79248
79264
  const {
79249
79265
  right,
79250
79266
  bottom
79251
79267
  } = this.position;
79268
+ const windowHeight = window.innerHeight;
79269
+ const bottomValue = parseInt(bottom) || 20;
79270
+
79271
+ // 更新菜单样式
79252
79272
  this.menuStyle = {
79273
+ ...this.menuStyle,
79253
79274
  right: right,
79254
79275
  bottom: bottom
79255
79276
  };
79256
79277
 
79257
- // 初始化当前位置
79258
- const windowHeight = window.innerHeight;
79259
- const bottomValue = parseInt(bottom) || 20;
79278
+ // 更新当前位置
79260
79279
  this.currentPosition = {
79261
79280
  x: 0,
79262
- y: windowHeight - bottomValue - this.mainButtonSize // 使用动态主按钮大小
79281
+ y: windowHeight - bottomValue - this.mainButtonSize
79263
79282
  };
79264
79283
  },
79265
79284
  // 切换菜单展开状态
@@ -79283,10 +79302,8 @@ var ByFloatingMenuvue_type_template_id_08613879_staticRenderFns = [];
79283
79302
  transition: 'right 0.3s ease',
79284
79303
  opacity: '0'
79285
79304
  };
79286
- // 只有在页面可见时才创建显示按钮
79287
- if (!document.hidden) {
79288
- this.createShowButton();
79289
- }
79305
+ // 创建显示按钮,使用当前纵向位置
79306
+ this.createShowButton();
79290
79307
  } else {
79291
79308
  // 显示主菜单,保持当前位置
79292
79309
  this.menuStyle = {
@@ -79429,50 +79446,11 @@ var ByFloatingMenuvue_type_template_id_08613879_staticRenderFns = [];
79429
79446
  document.removeEventListener('mousemove', this.onDrag);
79430
79447
  document.removeEventListener('mouseup', this.endDrag);
79431
79448
  },
79432
- // 绑定页面相关事件
79433
- bindPageEvents() {
79434
- // 监听页面可见性变化(切换 tab)
79435
- document.addEventListener('visibilitychange', this.onVisibilityChange);
79436
-
79437
- // 监听页面卸载事件
79438
- window.addEventListener('beforeunload', this.onPageUnload);
79439
-
79440
- // 监听路由变化(如果使用了 Vue Router)
79441
- if (this.$router) {
79442
- this.$router.beforeEach((to, from, next) => {
79443
- // 在路由切换前移除显示按钮
79444
- this.removeShowButton();
79445
- next();
79446
- });
79447
- }
79448
- },
79449
- // 解绑页面相关事件
79450
- unbindPageEvents() {
79451
- document.removeEventListener('visibilitychange', this.onVisibilityChange);
79452
- window.removeEventListener('beforeunload', this.onPageUnload);
79453
- },
79454
- // 页面可见性变化处理
79455
- onVisibilityChange() {
79456
- if (document.hidden) {
79457
- // 页面变为隐藏状态(切换 tab 或最小化),移除显示按钮
79458
- this.removeShowButton();
79459
- }
79460
- },
79461
- // 页面卸载处理
79462
- onPageUnload() {
79463
- // 页面卸载前移除显示按钮
79464
- this.removeShowButton();
79465
- },
79466
79449
  // 创建显示按钮
79467
79450
  createShowButton() {
79468
79451
  // 先移除可能存在的显示按钮
79469
79452
  this.removeShowButton();
79470
79453
 
79471
- // 如果页面不可见,不创建显示按钮
79472
- if (document.hidden) {
79473
- return;
79474
- }
79475
-
79476
79454
  // 计算当前主按钮的纵向位置
79477
79455
  let topPosition = '50%';
79478
79456
  if (this.menuStyle.top) {
@@ -79549,6 +79527,88 @@ var ByFloatingMenuvue_type_template_id_08613879_staticRenderFns = [];
79549
79527
  if (showBtn) {
79550
79528
  showBtn.remove();
79551
79529
  }
79530
+ },
79531
+ // ========== 外部调用方法 ==========
79532
+
79533
+ // 显示悬浮菜单
79534
+ show() {
79535
+ if (this.isHidden) {
79536
+ this.isHidden = false;
79537
+ this.isExpanded = false;
79538
+
79539
+ // 显示主菜单,保持当前位置
79540
+ this.menuStyle = {
79541
+ ...this.menuStyle,
79542
+ right: '20px',
79543
+ transition: 'right 0.3s ease, opacity 0.3s ease',
79544
+ opacity: '1'
79545
+ };
79546
+ // 移除显示按钮
79547
+ this.removeShowButton();
79548
+ }
79549
+ },
79550
+ // 隐藏悬浮菜单
79551
+ hide() {
79552
+ if (!this.isHidden) {
79553
+ this.isHidden = true;
79554
+ this.isExpanded = false;
79555
+
79556
+ // 保持当前纵向位置,只隐藏横向
79557
+ this.menuStyle = {
79558
+ ...this.menuStyle,
79559
+ right: '-100px',
79560
+ transition: 'right 0.3s ease',
79561
+ opacity: '0'
79562
+ };
79563
+ // 移除显示按钮
79564
+ this.removeShowButton();
79565
+ }
79566
+ },
79567
+ // 完全移除显示按钮(用于页面切换时清理)
79568
+ removeShowButtonOnly() {
79569
+ this.removeShowButton();
79570
+ },
79571
+ // 获取当前隐藏状态
79572
+ getHiddenState() {
79573
+ return this.isHidden;
79574
+ },
79575
+ // 切换显示/隐藏状态
79576
+ toggle() {
79577
+ this.toggleHide();
79578
+ },
79579
+ // 绑定页面相关事件
79580
+ bindPageEvents() {
79581
+ // 监听页面可见性变化(切换 tab)
79582
+ document.addEventListener('visibilitychange', this.onVisibilityChange);
79583
+
79584
+ // 监听页面卸载事件
79585
+ window.addEventListener('beforeunload', this.onPageUnload);
79586
+
79587
+ // 监听路由变化(如果使用了 Vue Router)
79588
+ if (this.$router) {
79589
+ this.$router.beforeEach((to, from, next) => {
79590
+ // 在路由切换前移除显示按钮
79591
+ this.removeShowButton();
79592
+ next();
79593
+ });
79594
+ }
79595
+ },
79596
+ // 解绑页面相关事件
79597
+ unbindPageEvents() {
79598
+ document.removeEventListener('visibilitychange', this.onVisibilityChange);
79599
+ window.removeEventListener('beforeunload', this.onPageUnload);
79600
+ },
79601
+ // 页面可见性变化处理
79602
+ onVisibilityChange() {
79603
+ if (document.hidden) {
79604
+ // 页面变为隐藏状态(切换 tab 或最小化),移除显示按钮
79605
+ this.removeShowButton();
79606
+ }
79607
+ },
79608
+ // 页面卸载处理
79609
+ onPageUnload() {
79610
+ // 页面卸载前移除显示按钮
79611
+ this.removeShowButton();
79552
79612
  }
79553
79613
  }
79554
79614
  });
@@ -79564,8 +79624,8 @@ var ByFloatingMenuvue_type_template_id_08613879_staticRenderFns = [];
79564
79624
  ;
79565
79625
  var ByFloatingMenu_component = normalizeComponent(
79566
79626
  floating_menu_ByFloatingMenuvue_type_script_lang_js,
79567
- ByFloatingMenuvue_type_template_id_08613879_render,
79568
- ByFloatingMenuvue_type_template_id_08613879_staticRenderFns,
79627
+ ByFloatingMenuvue_type_template_id_365e7526_render,
79628
+ ByFloatingMenuvue_type_template_id_365e7526_staticRenderFns,
79569
79629
  false,
79570
79630
  null,
79571
79631
  null,