element-plus
Version:
A Component Library for Vue 3
132 lines (128 loc) • 3.13 kB
JavaScript
'use strict';
var runtime = require('../../../utils/vue/props/runtime.js');
var typescript = require('../../../utils/typescript.js');
var types = require('../../../utils/types.js');
const imageProps = runtime.buildProps({
/**
* @description when enabling preview, use this flag to control whether clicking on backdrop can exit preview mode.
*/
hideOnClickModal: Boolean,
/**
* @description image source, same as native.
*/
src: {
type: String,
default: ""
},
/**
* @description indicate how the image should be resized to fit its container, same as [object-fit](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit).
*/
fit: {
type: String,
values: ["", "contain", "cover", "fill", "none", "scale-down"],
default: ""
},
/**
* @description Indicates how the browser should load the image, same as [native](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/img#loading)
*/
loading: {
type: String,
values: ["eager", "lazy"]
},
/**
* @description whether to use lazy load.
*/
lazy: Boolean,
/**
* @description the container to add scroll listener when using lazy load.
*/
scrollContainer: {
type: runtime.definePropType([String, Object])
},
/**
* @description allow big image preview.
*/
previewSrcList: {
type: runtime.definePropType(Array),
default: () => typescript.mutable([])
},
/**
* @description whether to append image-viewer to body. A nested parent element attribute transform should have this attribute set to `true`.
*/
previewTeleported: Boolean,
/**
* @description set image preview z-index.
*/
zIndex: {
type: Number
},
/**
* @description initial preview image index, less than the length of `url-list`.
*/
initialIndex: {
type: Number,
default: 0
},
/**
* @description whether the viewer preview is infinite.
*/
infinite: {
type: Boolean,
default: true
},
/**
* @description whether the image-viewer can be closed by pressing ESC.
*/
closeOnPressEscape: {
type: Boolean,
default: true
},
/**
* @description the zoom rate of the image viewer zoom event
*/
zoomRate: {
type: Number,
default: 1.2
},
/**
* @description preview image scale.
*/
scale: {
type: Number,
default: 1
},
/**
* @description the min scale of the image viewer zoom event.
*/
minScale: {
type: Number,
default: 0.2
},
/**
* @description the max scale of the image viewer zoom event.
*/
maxScale: {
type: Number,
default: 7
},
/**
* @description show preview image progress content.
*/
showProgress: Boolean,
/**
* @description set HTML attribute: crossorigin.
*/
crossorigin: {
type: runtime.definePropType(String)
}
});
const imageEmits = {
load: (evt) => evt instanceof Event,
error: (evt) => evt instanceof Event,
switch: (val) => types.isNumber(val),
close: () => true,
show: () => true
};
exports.imageEmits = imageEmits;
exports.imageProps = imageProps;
//# sourceMappingURL=image.js.map