mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 10:07:07 +00:00
feat(image): add native decoding
prop to Image component (#13487)
This commit is contained in:
@@ -52,6 +52,7 @@ export const imageProps = {
|
|||||||
loadingIcon: makeStringProp('photo'),
|
loadingIcon: makeStringProp('photo'),
|
||||||
crossorigin: String as PropType<ImgHTMLAttributes['crossorigin']>,
|
crossorigin: String as PropType<ImgHTMLAttributes['crossorigin']>,
|
||||||
referrerpolicy: String as PropType<ImgHTMLAttributes['referrerpolicy']>,
|
referrerpolicy: String as PropType<ImgHTMLAttributes['referrerpolicy']>,
|
||||||
|
decoding: String as PropType<ImgHTMLAttributes['decoding']>,
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ImageProps = ExtractPropTypes<typeof imageProps>;
|
export type ImageProps = ExtractPropTypes<typeof imageProps>;
|
||||||
@@ -153,6 +154,7 @@ export default defineComponent({
|
|||||||
const attrs = {
|
const attrs = {
|
||||||
alt: props.alt,
|
alt: props.alt,
|
||||||
class: bem('img'),
|
class: bem('img'),
|
||||||
|
decoding: props.decoding,
|
||||||
style: {
|
style: {
|
||||||
objectFit: props.fit,
|
objectFit: props.fit,
|
||||||
objectPosition: props.position,
|
objectPosition: props.position,
|
||||||
|
Reference in New Issue
Block a user