vdesign-ui 0.2.13 → 0.2.14

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.
@@ -222,7 +222,7 @@ export default {
222
222
  }
223
223
  },
224
224
  scrollToActiveTab() {
225
- const scrollWrapper = this.$refs.nav; // 修改这里
225
+ const scrollWrapper = this.$refs.nav;
226
226
  const tabItems = this.$refs.tabItems;
227
227
 
228
228
  if (!scrollWrapper || !tabItems || tabItems.length === 0) {
@@ -260,6 +260,17 @@ export default {
260
260
  }
261
261
  }
262
262
  });
263
+ },
264
+ /**
265
+ * resize 方法
266
+ * 当外层元素大小或组件显示状态变化时调用,触发重绘
267
+ */
268
+ resize() {
269
+ // 重新计算当前激活标签的位置
270
+ this.scrollToActiveTab();
271
+
272
+ // 如果有其他需要重绘或重新计算的逻辑,可以在这里添加
273
+ // 例如,重新计算动画轨道的位置等
263
274
  },
264
275
  },
265
276
  mounted() {
@@ -271,10 +282,10 @@ export default {
271
282
  }
272
283
  // 初始加载时,滚动到当前激活的标签
273
284
  this.$nextTick(() => {
274
- this.scrollToActiveTab();
275
- });
276
- },
277
- };
285
+ this.scrollToActiveTab();
286
+ });
287
+ },
288
+ };
278
289
  </script>
279
290
  <style lang="less">
280
291
  @import "./style.less";