react练习demo做todolist

博客做着做着感觉自己在囫囵吞,下来补充一下基本知识,从简单开始做起。
todolist基本练习demo,使用less和antd

github 的代码地址:https://github.com/3sang/react-practice-todolist
这是做完的界面:
还有自适应的部分。使用antd的栅栏布局做的
在这里插入图片描述
在这里插入图片描述

1.npm install -g create-react-app;
2.create-react-app my-app(my-app为项目名字);

1、先做出布局。
打算分成两个组件,list组件和父组件。
功能:
1、展示list
2、input添加list
3、删除List
4、对list打勾划线

使用antd:
yarn add antd 或者npm install antd --save
npm install @ant-design/icons
怎么用antd可以看这个https://www.cnblogs.com/orzzt/p/9719783.html

报错:
index.js:1 Warning: Failed prop type: You provided a checked prop to a form field without an onChange handler. This will render a read-only field. If the field should be mutable use defaultChecked. Otherwise, set either onChange or readOnly.

原因是因为input标签,没有定义onChange 但是提供了value属性。React会抛出警告,并将元素设置为只读。
如果目标是只读字段,最好使用readOnly属性明确加以定义。这不仅会消除警告,也会确保代码的可读性。

antd水平垂直布局:
<Row type=“flex” justify=“center” align=“middle” style={{minHeight:‘100vh’}}>

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值