-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat: 优化搜索交互 #76
feat: 优化搜索交互 #76
Conversation
@crazyair is attempting to deploy a commit to the cnpmweb Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/components/LandingSearch.tsx
Outdated
suffixIcon={null} | ||
onSearch={setSearch} | ||
autoFocus | ||
onChange={(search) => router.push(`/package/${search}`)} |
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.
加下 shallow
配置? 点击搜索结果后现在跳转有点慢 😭
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.
不清楚为什么会卡,可能开发环境问题,我本地测试也是一会快一会慢
iShot_2024-03-18_08.56.18.mp4
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.
嗯 没开 shallow 的话,会优先尝试 fetch 一下资源,感觉上就会有点卡顿
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.
这个是试过加了一次,感觉没区别呀?要不我加下?
closeIcon={closeIcon} | ||
onClose={() => onClose?.(tag.label)} | ||
> | ||
<Link href={tag.href}>{tag.label}</Link> |
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.
这个会有 a 嵌套 a 的警告,可以先不管
+1 👍🏻 感谢贡献 搜索体验好了很多 |
进入结果页面 https://npmmirror.com/packages?q=antd 刷新页面会异常 iShot_2024-03-18_16.51.00.mp4这个问题还没有解决,不知道怎么解决 |
@crazyair @elrrrrrrr 改完出 bug 了?搜索 url 直接访问会跳转到 pkg 页面 https://npmmirror.com/packages?q=antd |
之前就有 |
iShot_2024-03-17_17.35.29.mp4