Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jhygreatbug
Copy link

  • vite-imagetools 6.x 数据结构发生变化
    • 字段名称 fallback -> img
    • sources 简化成字符串数组
  • 测试 demo 增加 vite-imagetools 配置

@Amorites
Copy link
Contributor

readme 里有相关的部分也改一下吧

};
};

// v6.0.0以下
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

实际上是4.x,5.x 不是这样的


## 使用

> 建议配合 (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) 使用
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vite-plugin-image-presets 相关的东西都去掉吧,现在不建议了


```ts
interface PictureProp {
src: ImgHTMLAttributes[];
src: Array<ImagePresetPictureOption | ImageToolsPictureOption | ImageToolsPictureOptionOld>;
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个old是代表啥,之前支持这样吗?

Copy link
Author

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 区分了下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants