Skip to content

feat(types): 适配升级vue-tsc 3.2.6类型报错问题#1478

Open
SuperTylerX wants to merge 1 commit intoMoonofweisheng:masterfrom
SuperTylerX:feature/upgrade-tsc-3
Open

feat(types): 适配升级vue-tsc 3.2.6类型报错问题#1478
SuperTylerX wants to merge 1 commit intoMoonofweisheng:masterfrom
SuperTylerX:feature/upgrade-tsc-3

Conversation

@SuperTylerX
Copy link

@SuperTylerX SuperTylerX commented Mar 19, 2026

🤔 这个 PR 的性质是?(至少选择一个)

  • 日常 bug 修复
  • 新特性提交
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • CI/CD 改进
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 代码重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

暂无直接关联 Issue。
本次修复来源于本地 type-check 报错排查与修正。

💡 需求背景和解决方案

需求背景:

执行 type-check 时出现 4 个 TypeScript 错误,涉及 ActionSheet 和 Slider 两个组件。
错误集中在模板中索引类型推断不匹配,以及事件参数隐式 any。

解决方案:

ActionSheet 中将面板点击传参的 colIndex 显式转换为 number,保证与函数参数类型一致。
Slider 中将模板内联箭头事件写法改为直接使用 $event 传参,消除事件参数隐式 any 报错。
修复后再次执行 type-check,错误已全部清除。
API 和用法:

无对外 API 变更。
仅修复类型定义和模板类型推断问题,不影响现有功能行为。

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充

Summary by CodeRabbit

发行说明

  • 错误修复

    • 修复了 action-sheet 组件中的类型处理问题
    • 优化了 slider 组件的事件处理机制
  • 任务

    • 升级 TypeScript 类型检查工具至最新版本

@vercel
Copy link

vercel bot commented Mar 19, 2026

@SuperTylerX is attempting to deploy a commit to the weisheng's projects Team on Vercel.

A member of the Team first needs to authorize it.

@netlify
Copy link

netlify bot commented Mar 19, 2026

Deploy Preview for wot-design-uni ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 2a86f67
🔍 Latest deploy log https://app.netlify.com/projects/wot-design-uni/deploys/69bb7a55e1d0df0008b244ad
😎 Deploy Preview https://deploy-preview-1478--wot-design-uni.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: fb7f32a4-de7f-4e6a-b9ab-5dfacbb08b7b

📥 Commits

Reviewing files that changed from the base of the PR and between 507e88a and 2a86f67.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • package.json
  • src/uni_modules/wot-design-uni/components/wd-action-sheet/wd-action-sheet.vue
  • src/uni_modules/wot-design-uni/components/wd-slider/wd-slider.vue

总览

此PR包含三项改动:更新 vue-tsc 开发依赖从 2.0.29 至 3.2.6 版本,在 ActionSheet 组件中对点击处理器参数添加类型强制转换,在 Slider 组件中调整 touchstart 事件绑定的传递方式。

变更清单

内聚组 / 文件 变更摘要
依赖版本更新
package.json
vue-tsc 开发依赖从 ^2.0.29 升级至 ^3.2.6,用于类型检查脚本。
组件类型改进
src/uni_modules/wot-design-uni/components/wd-action-sheet/wd-action-sheet.vue
formatPanels 循环中的点击处理器中,将 colIndex 强制转换为 number 类型后传递给 select() 方法,确保参数类型对齐。
事件处理优化
src/uni_modules/wot-design-uni/components/wd-slider/wd-slider.vue
将滑块 touchstart 事件绑定从箭头函数包装 (event) => onSliderTouchStart(event, <index>) 改为直接传递原生事件 $event,适用于左右滑块和单滑块模式。

相关 PR

建议审查人

  • Moonofweisheng

代码审查工作量估算

🎯 2 (Simple) | ⏱️ ~12 分钟

🐰 版本升级添妙趣,
类型强转显严谨,
事件优化如春风,
滑块与单页共轮转,
小改进,大精进!✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题清晰地总结了主要变更:升级vue-tsc至3.2.6版本并修复相应的类型报错问题。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can generate walkthrough in a markdown collapsible section to save space.

Enable the reviews.collapse_walkthrough setting to generate walkthrough in a markdown collapsible section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant