-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: 支持 vite-imagetools 6.x #2
base: main
Are you sure you want to change the base?
Conversation
jhygreatbug
commented
Nov 20, 2023
- vite-imagetools 6.x 数据结构发生变化
- 字段名称 fallback -> img
- sources 简化成字符串数组
- 测试 demo 增加 vite-imagetools 配置
readme 里有相关的部分也改一下吧 |
}; | ||
}; | ||
|
||
// v6.0.0以下 |
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.
实际上是4.x,5.x 不是这样的
packages/picture/README.md
Outdated
|
||
## 使用 | ||
|
||
> 建议配合 (vite-plugin-image-presets) 使用 | ||
> 建议配合 [vite-plugin-image-presets](github.com/ElMassimo/vite-plugin-image-presets) 或 [vite-imagetools](https://github.com/JonasKruckenberg/imagetools/tree/main/packages/vite) 使用 |
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.
vite-plugin-image-presets 相关的东西都去掉吧,现在不建议了
packages/picture/README.md
Outdated
|
||
```ts | ||
interface PictureProp { | ||
src: ImgHTMLAttributes[]; | ||
src: Array<ImagePresetPictureOption | ImageToolsPictureOption | ImageToolsPictureOptionOld>; |
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.
感觉不太对
sources: { | ||
[key: string]: { | ||
src: string; | ||
w?: number; | ||
}[]; | ||
}; | ||
img: ImageToolsPictureOptionImg; |
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.
这个old是代表啥,之前支持这样吗?
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.
ImageToolsPictureOptionOld 吗,是 4.x 和 5.x 的类型,跟最新的 6.x 区分了下