Closed eiinu closed 1 week ago
这次更新主要涉及为Vue插件添加新的ESLint规则,以及在多个Vue组件和文档中引入新的beforeSwitch
功能。这个功能允许在切换标签之前执行异步检查逻辑,增强了标签切换的灵活性和可控性。
文件路径 | 修改摘要 |
---|---|
packages/nutui-eslint-config/index.js |
添加了新的ESLint规则'no-empty' 。 |
.../nutui-taro-demo/src/nav/pages/tabbar/before-switch.vue .../__VUE/tabbar/demo/before-switch.vue .../__VUE/tabbar/demo/index.vue |
新增了before-switch.vue 组件,包含标签切换逻辑。 |
src/packages/__VUE/tabbar/__tests__/index.spec.tsx |
更新了测试描述,添加了props.beforeSwitch 功能的测试。 |
src/packages/__VUE/tabbar/doc.en-US.md src/packages/__VUE/tabbar/doc.md src/packages/__VUE/tabbar/doc.taro.md |
更新了文档,添加了before-switch 回调函数的描述,并修改了v-model 参数类型。 |
src/packages/__VUE/tabbar/tabbar.taro.vue src/packages/__VUE/tabbar/tabbar.vue |
引入了beforeSwitch 属性,更新了changeIndex 函数以处理异步beforeSwitch 检查。 |
src/packages/__VUE/tabbaritem/tabbar-item.taro.vue src/packages/__VUE/tabbaritem/tabbar-item.vue |
重构了change 函数为异步函数,并添加了错误处理逻辑。 |
🐰✨
代码如诗,变化如梦, 标签切换,灵活掌控。 异步检查,前路通畅, ESLint新规,代码更强。 Vue中绽放,创新无疆, 代码世界,因你而亮。
— CodeRabbit
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 83.98%. Comparing base (
87f044d
) to head (3863c1e
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
这个 PR 做了什么? (简要描述所做更改)
这个 PR 是什么类型? (至少选择一个)
这个 PR 涉及以下平台:
这个 PR 是否已自测:
Summary by CodeRabbit
新功能
文档
before-switch
回调函数的说明。v-model
参数类型,从number
改为string \| number
。测试
beforeSwitch
功能的测试用例。重构