Skip to content
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

修复控制台报的错,重构部分代码,做出一些优化 #43

Merged
merged 18 commits into from
Feb 21, 2025

Conversation

Autumnal-Joy
Copy link
Collaborator

@Autumnal-Joy Autumnal-Joy commented Feb 21, 2025

fix:

  1. 修复各个页面循环渲染缺少key的报错
  2. 修复各个页面<a>标签连续嵌套的报错
  3. 修复复选框同时设置checked与defaultChecked的报错
  4. 修复onscroll事件在组件卸载后未被清理的报错
  5. 修复RatingCircle组件使用非法属性data的报错

refactor:

  1. 题单页面复用同一个List组件
  2. 将util目录重命名为utils
  3. 将项目内通过 "../.." 或 "../../.." 形式导入的组件改为 "@xxx" 导入
  4. 将hashCode函数提取到utils,改用md5生成hash
  5. 将各页面回到顶部的按钮封装为组件

optimize:

  1. 优化搜索页面筛选题解的函数逻辑
  2. 将搜索页面改写为分页列表,优化拖动浏览器窗口时的卡顿问题
  3. 将同步进度改为仅在Set Progress之后刷新页面

feature:

  1. 题单页面增加隐藏会员题的开关按钮
  2. 题单页面增加回到顶部的按钮

@@ -0,0 +1,5 @@
import { BinaryLike, createHash } from "crypto";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你在这里使用 NodeJS std 库里面的 "crypto" 在构建项目 (pnpm build or npm build) 的时候有没有报错?或者你这里单独安装了浏览器版本的实现吗?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有安装别的,我是pnpm install下载的依赖,然后我本地的pnpm-lock.json没有上传,package.json没有变化,然后我本地run dev没有报错

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以验证一下 "pnpm build", fail 的话可能需要安装一个 es6 模块的 crypto。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,我检查一下

@Autumnal-Joy
Copy link
Collaborator Author

@huxulm RatingCircle组件有个错误导致build失败,我本地不需要安装crypto就能build

build error

把错误改掉之后就能build

build success

@huxulm huxulm merged commit 2628e4d into huxulm:main Feb 21, 2025
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.

2 participants