2022.07.08
1 git拉代码权限问题
- 问题:clone代码的时候遇见权限报错,然而确实已经开通权限
- 解决:配置git账号密码的时候,用户名是之前设置的用户名,而不是邮箱名(自己设置过但是忘记了...)。
2 ssh方法拉不下代码
- 问题: 在配置了gitlab上的ssh之后仍然无法通过ssh方式clone代码,每次都需要输入密码然后就报无权限的错误
- 解决: 重新安装git.exe,安装的时候选择git内部的ssh
3 node-sass和nodejs版本不匹配的问题
- 问题:node-sass和nodejs版本不匹配的问题

4 无脑行为
- react中读状态的时候没写this.state.xxx
- 错误使用
arr.map(item=>{<div></div>})
,map方法应有返回值,应该写成arr.map(item=>{ return <div></div>})
或者arr.map(item=><div></div>)
- react中修改状态方法
this.setState(stateChange, callback)
,其中stateChange
是同步执行的,但是状态更新是异步的,需要在状态更新后、界面更新后调用的内容应该写到callback
回调函数里面
2022.07.15
1.Taro-UI滑动不显示
<AtList>
{list.map((item, index) => (
<AtSwipeAction
key={index}
onOpened={this.handleSingle.bind(this, index)}
isOpened={item.isOpened}
options={item.options}
>
<AtListItem title={item.title} />
</AtSwipeAction>
))}
</AtList>
- 解决:在
<AtSwipeAction></AtSwipeAction>
里面再写两个属性
<AtSwipeAction
maxDistance={80} // 该数值为按钮宽度乘以个数
areaWidth={Taro.getSystemInfoSync().windowWidth * 0.88} // 适配不同手机系统屏幕宽度`
>
</AtSwipeAction>
2022.07.19
1. git push问题
2.引入taro-ui报错
- 问题:项目中安装taro-ui之后跑代码,报错
Uncaught (in promise) TypeError: Super expression must either be null or a function
- 原因:网上查询是由于新版的taro-ui和新版taro不能兼容的问题
- 解决:安装低版本taro-ui,
npm install taro-ui@3.0.0-alpha.3
2022.07.21
1. react项目中图片导入问题
- 问题:使用
<img src="../pic.png" />
无法正常引入图片
- 解决:
- 方法一:
import imgUrl from '../pic.png'; <img src={imgUrl}/>
- 方法二:
<img {src=(../pic.png)} />