tusen-ai / naive-ui

A Vue 3 Component Library. Fairly Complete. Theme Customizable. Uses TypeScript. Fast.
https://www.naiveui.com
MIT License
16.26k stars 1.68k forks source link

轮播图设置属性为slides-per-view="auto"时表现异常 #6500

Closed QuarkPixel closed 2 days ago

QuarkPixel commented 4 weeks ago

描述错误

轮播图设置slides-per-view="auto"属性时,会报错:

Uncaught TypeError: slideSizesRef.effect.run is not a function
    at handleSlideResize (naive-ui.js?v=1392700f:71801:30)
    at handleResize (naive-ui.js?v=1392700f:4446:9)
    at ResizeObserverDelegate.handleResize (naive-ui.js?v=1392700f:4416:9)

并且对应的逻辑也会出现问题:最后一页的内容是无法正常加载的: CleanShot 2024-10-29 at 14 47 02 CleanShot 2024-10-29 at 14 46 15

复现步骤

  1. 滑动至轮播图的最后一页

最小复现链接

https://github.com/QuarkPixel/naive-ui-bug-minimal-reproduction

系统信息

System:
    OS: macOS 15.0.1
    CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
    Memory: 38.27 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.1 - /usr/local/bin/node
    npm: 10.2.4 - /usr/local/bin/npm
    pnpm: 9.12.2 - ~/Library/pnpm/pnpm
  Browsers:
    Safari: 18.0.1
  npmPackages:
    naive-ui: ^2.40.1 => 2.40.1 
    vue: ^3.5.12 => 3.5.12

使用的包管理器

pnpm

验证

jahnli commented 4 weeks ago

Provide a based on CodeSandbox or stackblitz `s Minimal Reproducible Example

QuarkPixel commented 3 weeks ago

Minimal Reproducible Example

jahnli commented 3 weeks ago

https://github.com/tusen-ai/naive-ui/pull/6438