-
Notifications
You must be signed in to change notification settings - Fork 1
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
除了与后端的连接之外,个人感觉做的差不多了 #14
Conversation
…r three seconds,during which the user can click the button again to cancel the previous opration.However, the problem is that when User deletes more than one items,only the last deleted item will disappear.This remains to be solved
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.
css里不得使用vw/vh,请把vw/vh改成rem单位。
首页的卡片请抽象成一个通用的卡片组件。
装好依赖后,请运行npm run lint检查lint错误。
src/components/todoList/TodoList.tsx
Outdated
return ( | ||
<div className="todowrapper"> | ||
<TodoHead /> | ||
{todoBody} |
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.
请把显示逻辑用三元运算符或&&内嵌,本组件所有逻辑都可以写在return的jsx语法里面
import NoneTodo from './NoneTodo/NoneTodo' | ||
import { todoList as initialTodos } from './todoList-body/TodoItem' | ||
/**将TodoItem组件在此拼装为整体 */ | ||
function TodoList() { |
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.
请用props传参。
onDelete等属性也要定义。
interface TodoItemProps extends TodoElement { | ||
onDelete: (id: number) => void | ||
} | ||
export const todoList: TodoElement[] = [ |
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.
请把测试数据向上级移动。
interface TodoItemProps extends TodoElement { | ||
onDelete: (id: number) => void | ||
} |
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.
请直接用交类型
interface Correspondence { | ||
1: string | ||
2: string | ||
3: string | ||
} |
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.
请用as const或Record<>代替,无需写这种类型。
> | ||
<div className="todoItemElement"> | ||
<span>{name}</span> | ||
<div>求是潮</div> |
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.
请用props
/* 应用 slideRight 动画,持续时间 3 秒,动画结束后保持最后状态,使用 ease-out 时间函数 */ | ||
animation: slideRight 1s ease-out; | ||
/* 防止删除过程中元素仍可交互 */ | ||
pointer-events: none; |
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.
还能否取消删除?
在web端可以,移动端是否会出问题?
…onveniently adding creating new components\n
No description provided.