Skip to content

Commit

Permalink
更新READMECN
Browse files Browse the repository at this point in the history
  • Loading branch information
slince-zero committed May 14, 2024
1 parent 8b5e81a commit 69dcc39
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions READMECN.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ Imkaer 是一款用来设计封面的工具,比如你可以为你的博客、

https://github.com/gezhaoyou/picprose


## 新特性
- 通过 AI 生成图片 🔥

- 通过 AI 生成图片 🔥

## 协议

Expand Down Expand Up @@ -182,3 +182,12 @@ query({ inputs: 'Astronaut riding a horse' }).then((response) => {
```

可以看到,API 返回的是一个 `blob` 对象,需要转换成 url 才能使用,因此我使用了 `createObjectURL` 来转换成 url, 但是这里有一个问题,就是这个数据是临时存在的,如果刷新页面,或者关闭,或者跳转页面,就会消失,因为我是只有一个页面,所以不存在这个问题;但我还是将其移动到了 `Context` 状态管理当中,这样就不会出现这个问题了。

## 关于为什么 leftBoard 组件中为什么不请求更多的图片,比如往下滑动加载图片

主要是一个原因:每次加载就会请求 API,但是 unsplash 做了限制,每小时只能请求 50 次,所以这样去监听滚动事件,很快次数就会用光

疑问:是否有其他的解决方案。

我开始实现这个向下滚动实现加载更多图片的时候,考虑的是,我每次滑倒底部,监听滑动事件,触发一次请求 API,这样子就可以实现展示其他的图片。
这里有一个 bug,是 NextUI 的,因为我用了它的 ScrollShadow 组件,滚动的时候会有阴影效果,它这个会影响我写的监听滚动事件。

0 comments on commit 69dcc39

Please sign in to comment.