-
Notifications
You must be signed in to change notification settings - Fork 33
feat(noticeBar): 通知栏支持自定义滚动速度 #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 3a81807 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
'animationDuration': `${mergedDuration}s`, | ||
'WebkitAnimationDuration': `${mergedDuration}s`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感觉这种实现方式会有问题,滚动速度跟文案长度相关了,文字越长,滚动越快
一般用户想要的效果应该是文字滚动速度恒定?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我看之前虽然文档中有说明speed
属性,但实际上并没有实现相关的逻辑,那么,我们预期的speed
属性的效果是怎样的呢?speed
属性所给的值代表的是整段文本在多长时间内的滚动速度呢?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
speed
属性应该是参考了taro-ui
的属性设计,但是当时却没有实现
想要实现的效果应该是用于控制文字滚动速度,设定该值后,文字滚动速度不应该和文案长度相关。实际使用中,文案内容往往是动态的,如果业务中文案长度变化范围较大,对用户侧来说,通知栏的体验会不一致。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
恩恩,确实是这样,我找时间参考一下其他组件库的设计,实现一下speed
的逻辑吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感觉咱们可以直接引入这个库处理文字滚动的逻辑,我看很多react
UI库都使用这个
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以试试看,需要看下其他端小程序的表现是否符合预期
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
目前scrollable
属性好像失效了
另外,目前Marquee
内部实现使用的是div标签,在打包之后,div标签依旧存在,而taro支持html标签是从3.3版本开始的,感觉需要验证下老版本taro的支持度
好的,我抽空优化并验证一下,最近比较忙 |
Deployment failed with the following error:
|
既然这些框架没有现成的同时支持小程序和h5的逻辑,那么我们就自己实现自定义滚动的逻辑吧。传入的速度 |
动态获取内容的宽度做计算,我觉得可行 |
lgtm 👍 |
理论上解决乱码问题才是正确的解决方案,我上次试了下,好像没有找到解决方案😅 |
那这边临时将自定义滚动的实例的文字改成英文,这样就不会因为乱码导致宽度与实际不一致而用例不通过了 |
感觉应该是基础镜像 |
👍 |
* chore: 增加开发实时编译命令 (#56) * fix: taost组件customStyle报错未生效 (#55) * release: 0.3.5 * chore: auto publish to npm * Update release.yml * docs: update docs * docs: update docs * feat: 走马灯点击回调支持传入当前点击子项索引 * fix(Carousel): indicatorColor 与默认保持一致 * Create short-elephants-promise.md * Update verifyCommit.js * Update release.yml * Update release.yml * chore: auto release * feat: 增加倒计时组件Countdown * chore: changeset * feat: 增加format属性&定时器清除 * fix(Badge): 修复 Badge 的 info 为 0 或为空时显示异常问题 (#58) * feat: 角标默认值逻辑与相关文档修改 * feat: 角标默认值逻辑与相关文档修改 * feat: 更新测试用例 * feat: 更新注释 * feat: update changeset * fix: add Badge default type value Co-authored-by: tangwenhui <tangwenhui@rd.netease.com> Co-authored-by: CaedmonW <caedmonwa@gmail.com> * feat: Radio 受控 可由 RadioGroup 控制 (#49) * feat: Radio 受控 可由 RadioGroup 控制 * docs: add desc Co-authored-by: CaedmonW <caedmonwa@gmail.com> * Version Packages (#64) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Update release.yml * docs: 删除冗余输入框类型 (#67) * docs: 删除冗余输入框类型 * chore: update changeset Co-authored-by: tangwenhui <tangwenhui@rd.netease.com> * fix: 删除图片预览冗余代码 (#68) * fix: 删除图片预览冗余代码 * chore: update changeset Co-authored-by: tangwenhui <tangwenhui@rd.netease.com> * docs: 修改文档中 input 组件错误属性类型描述 * chore: update changeset * docs: 补充 showSplitLine 属性文档说明 * feat: input 组件是否显示字符计数器属性名使用 showCount 属性替代 * feat: update demo * docs: 删除 demo 中冗余代码 * chore: update changeset * docs: 补充列表组件缺少的 leftIconSize 属性文档描述 * docs: navBar 组件中 rightSlot 属性描述有误 * refactor: refactor call expression * chore: update changeset * refactor: refactor call expression * chore: 版本号 * feat: 单选按钮 api 命名规范化 & 增加安全使用过期属性方法 * feat: 单选按钮 api 命名规范化 & 增加安全使用过期属性方法 * chore: update changeset * feat: update docs * feat: 类型优化 * feat: 代码优化 * feat: 代码优化 * feat: 代码优化 * Update dirty-suns-punch.md * feat: 类型优化 * feat: 文档优化 * feat: 文档优化 * feat: 代码优化 * Update packages/ossa/src/utils/index.ts Co-authored-by: CaedmonW <107974245+CaedmonW@users.noreply.github.com> * chore: add code of conduct * chore: add Security Policy * fix: 图片预览&轮播支付宝兼容 (#57) * fix: 图片预览&轮播支付宝兼容 * chore: changeset * Version Packages (#69) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * feat(noticeBar): 通知栏支持自定义滚动速度 (#78) * feat: 通知栏自定义滚动时长支持 * chore: update changeset * feat: 增加测试用例 * feat: 增加测试用例 * feat: 实现自定义文字滚动速度 * feat: 更新测试用例 * feat: 更新测试用例 * feat: 更新测试用例 * feat: 重构文字滚动逻辑 * feat: 生成随机id用于获取目标元素 * feat: update test case * feat: update test case * feat: update test case * fix(noticeBar): 临时将 noticeBar 自定义滚动示例中的内容改为英文,解决 ci 运行测试任务中文乱码导致不通过问题 (#86) * fix: 临时将 noticeBar 自定义滚动示例中的内容改为英文,解决 ci 运行测试任务中文乱码导致不通过问题 * chore: update changeset * 文件命名格式更改 (#84) * chore: 文件命名格式更改 * chore: add changeset * fix: file name changed * chore: pnpm lock file conflict * fix(noticeBar): bias in CI (#88) * Version Packages (#85) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * feat: 新增营销组件@ossa/loki (#87) * feat: 新增营销组件ossaui-loki * fix: 修改loki pkg名称 * fix: prebundler limi add @ossa/loki * fix: 修改style引入名称 * feat: 新增loki 使用文档 * fix: 修改pkg信息 * fix: 修复process.env全局注入引用异常 * fix: 优化px2rem * fix: 优化loki H5兼容计算 * fix: 优化loki H5兼容计算 * fix: 优化loki H5兼容计算 * fix: 优化loki H5兼容计算 * fix: 修改九宫格样式 * fix: 修改ossa-demo关联loki的版本 * feat: merge main * feat: merge main * fix: update changeset Co-authored-by: xuyang03 <xuyang03@corp.netease.com> * Update ci.yml * Version Packages * Update package.json * feat: 完善 tab-bar 组件文档与类型描述 (#94) * feat: 完善 switch 组件相关文档 & 类型描述优化 (#93) * feat: 补充步进器相关文档与类型描述 (#90) * feat: 完善评分组件文档 & 优化属性命名 (#89) * chore: 倒计时放入数据展示目录下 * chore: 增加countdown.scss文件 * feat: 增加滑动单元格组件swipe-cell * chore: changeset * chore: 修改代码格式&类型注释 * feat: 右侧滑动区域默认展示 * test: swipe-cell增加测试用例 * test: fix test * Feature build command (#101) * fix: vercel build artifact error * chore: build command * fix: swipe-cell测试用例修复 (#102) * feat: modal组件confirm 按钮支持openType (#76) * fix: vercel build artifact error * chore: build command * feat: modal组件confirm 按钮支持openType * refactor(Modal): call expression * docs(modal): 属性详细说明 * fix: fix input disabledClear (#100) * fix: fix input disabledClear * Create forty-carrots-beg.md Co-authored-by: CaedmonW <107974245+CaedmonW@users.noreply.github.com> * fix: 修改部分 stepper 组件错误 与完善类型描述 (#99) * Version Packages (#96) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * chore: change check modify command (#103) * Feature upload callback (#105) * feat(uplaod): add onImageClick * fix: import path * docs: onFail type definition * fix: cnpm package install failed * refactor: update typescript version * chore: lock @swc/core to 1.3.6 * Version Packages (#106) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: ZengJie <48742371+Zeng-J@users.noreply.github.com> Co-authored-by: CaedmonW <caedmonwa@gmail.com> Co-authored-by: CaedmonW <107974245+CaedmonW@users.noreply.github.com> Co-authored-by: tangwenhui <tangwenhui@rd.netease.com> Co-authored-by: jianzhouf <18003152+jianzhouf@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Xu <1750978657@qq.com> Co-authored-by: xuyang03 <xuyang03@corp.netease.com>
这个 PR 做了什么? (简要描述所做更改)
这个 PR 是什么类型? (至少选择一个)
这个 PR 涉及以下平台: