first
This commit is contained in:
250
node_modules/vant/lib/image-preview/ImagePreview.js
generated
vendored
Normal file
250
node_modules/vant/lib/image-preview/ImagePreview.js
generated
vendored
Normal file
@ -0,0 +1,250 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _shared = require("./shared");
|
||||
|
||||
var _popup = require("../mixins/popup");
|
||||
|
||||
var _touch = require("../mixins/touch");
|
||||
|
||||
var _bindEvent = require("../mixins/bind-event");
|
||||
|
||||
var _icon = _interopRequireDefault(require("../icon"));
|
||||
|
||||
var _swipe = _interopRequireDefault(require("../swipe"));
|
||||
|
||||
var _ImagePreviewItem = _interopRequireDefault(require("./ImagePreviewItem"));
|
||||
|
||||
// Utils
|
||||
// Mixins
|
||||
// Components
|
||||
var _default2 = (0, _shared.createComponent)({
|
||||
mixins: [_touch.TouchMixin, (0, _popup.PopupMixin)({
|
||||
skipToggleEvent: true
|
||||
}), (0, _bindEvent.BindEventMixin)(function (bind) {
|
||||
bind(window, 'resize', this.resize, true);
|
||||
bind(window, 'orientationchange', this.resize, true);
|
||||
})],
|
||||
props: {
|
||||
className: null,
|
||||
closeable: Boolean,
|
||||
asyncClose: Boolean,
|
||||
overlayStyle: Object,
|
||||
showIndicators: Boolean,
|
||||
images: {
|
||||
type: Array,
|
||||
default: function _default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
loop: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
overlay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
minZoom: {
|
||||
type: [Number, String],
|
||||
default: 1 / 3
|
||||
},
|
||||
maxZoom: {
|
||||
type: [Number, String],
|
||||
default: 3
|
||||
},
|
||||
transition: {
|
||||
type: String,
|
||||
default: 'van-fade'
|
||||
},
|
||||
showIndex: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
swipeDuration: {
|
||||
type: [Number, String],
|
||||
default: 300
|
||||
},
|
||||
startPosition: {
|
||||
type: [Number, String],
|
||||
default: 0
|
||||
},
|
||||
overlayClass: {
|
||||
type: String,
|
||||
default: (0, _shared.bem)('overlay')
|
||||
},
|
||||
closeIcon: {
|
||||
type: String,
|
||||
default: 'clear'
|
||||
},
|
||||
closeOnPopstate: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
closeIconPosition: {
|
||||
type: String,
|
||||
default: 'top-right'
|
||||
}
|
||||
},
|
||||
data: function data() {
|
||||
return {
|
||||
active: 0,
|
||||
rootWidth: 0,
|
||||
rootHeight: 0,
|
||||
doubleClickTimer: null
|
||||
};
|
||||
},
|
||||
mounted: function mounted() {
|
||||
this.resize();
|
||||
},
|
||||
watch: {
|
||||
startPosition: 'setActive',
|
||||
value: function value(val) {
|
||||
var _this = this;
|
||||
|
||||
if (val) {
|
||||
this.setActive(+this.startPosition);
|
||||
this.$nextTick(function () {
|
||||
_this.resize();
|
||||
|
||||
_this.$refs.swipe.swipeTo(+_this.startPosition, {
|
||||
immediate: true
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.$emit('close', {
|
||||
index: this.active,
|
||||
url: this.images[this.active]
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
resize: function resize() {
|
||||
if (this.$el && this.$el.getBoundingClientRect) {
|
||||
var rect = this.$el.getBoundingClientRect();
|
||||
this.rootWidth = rect.width;
|
||||
this.rootHeight = rect.height;
|
||||
}
|
||||
},
|
||||
emitClose: function emitClose() {
|
||||
if (!this.asyncClose) {
|
||||
this.$emit('input', false);
|
||||
}
|
||||
},
|
||||
emitScale: function emitScale(args) {
|
||||
this.$emit('scale', args);
|
||||
},
|
||||
setActive: function setActive(active) {
|
||||
if (active !== this.active) {
|
||||
this.active = active;
|
||||
this.$emit('change', active);
|
||||
}
|
||||
},
|
||||
genIndex: function genIndex() {
|
||||
var h = this.$createElement;
|
||||
|
||||
if (this.showIndex) {
|
||||
return h("div", {
|
||||
"class": (0, _shared.bem)('index')
|
||||
}, [this.slots('index', {
|
||||
index: this.active
|
||||
}) || this.active + 1 + " / " + this.images.length]);
|
||||
}
|
||||
},
|
||||
genCover: function genCover() {
|
||||
var h = this.$createElement;
|
||||
var cover = this.slots('cover');
|
||||
|
||||
if (cover) {
|
||||
return h("div", {
|
||||
"class": (0, _shared.bem)('cover')
|
||||
}, [cover]);
|
||||
}
|
||||
},
|
||||
genImages: function genImages() {
|
||||
var _this2 = this;
|
||||
|
||||
var h = this.$createElement;
|
||||
return h(_swipe.default, {
|
||||
"ref": "swipe",
|
||||
"attrs": {
|
||||
"lazyRender": true,
|
||||
"loop": this.loop,
|
||||
"duration": this.swipeDuration,
|
||||
"initialSwipe": this.startPosition,
|
||||
"showIndicators": this.showIndicators,
|
||||
"indicatorColor": "white"
|
||||
},
|
||||
"class": (0, _shared.bem)('swipe'),
|
||||
"on": {
|
||||
"change": this.setActive
|
||||
}
|
||||
}, [this.images.map(function (image) {
|
||||
return h(_ImagePreviewItem.default, {
|
||||
"attrs": {
|
||||
"src": image,
|
||||
"show": _this2.value,
|
||||
"active": _this2.active,
|
||||
"maxZoom": _this2.maxZoom,
|
||||
"minZoom": _this2.minZoom,
|
||||
"rootWidth": _this2.rootWidth,
|
||||
"rootHeight": _this2.rootHeight
|
||||
},
|
||||
"on": {
|
||||
"scale": _this2.emitScale,
|
||||
"close": _this2.emitClose
|
||||
}
|
||||
});
|
||||
})]);
|
||||
},
|
||||
genClose: function genClose() {
|
||||
var h = this.$createElement;
|
||||
|
||||
if (this.closeable) {
|
||||
return h(_icon.default, {
|
||||
"attrs": {
|
||||
"role": "button",
|
||||
"name": this.closeIcon
|
||||
},
|
||||
"class": (0, _shared.bem)('close-icon', this.closeIconPosition),
|
||||
"on": {
|
||||
"click": this.emitClose
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onClosed: function onClosed() {
|
||||
this.$emit('closed');
|
||||
},
|
||||
// @exposed-api
|
||||
swipeTo: function swipeTo(index, options) {
|
||||
if (this.$refs.swipe) {
|
||||
this.$refs.swipe.swipeTo(index, options);
|
||||
}
|
||||
}
|
||||
},
|
||||
render: function render() {
|
||||
var h = arguments[0];
|
||||
return h("transition", {
|
||||
"attrs": {
|
||||
"name": this.transition
|
||||
},
|
||||
"on": {
|
||||
"afterLeave": this.onClosed
|
||||
}
|
||||
}, [this.shouldRender ? h("div", {
|
||||
"directives": [{
|
||||
name: "show",
|
||||
value: this.value
|
||||
}],
|
||||
"class": [(0, _shared.bem)(), this.className]
|
||||
}, [this.genClose(), this.genImages(), this.genIndex(), this.genCover()]) : null]);
|
||||
}
|
||||
});
|
||||
|
||||
exports.default = _default2;
|
261
node_modules/vant/lib/image-preview/ImagePreviewItem.js
generated
vendored
Normal file
261
node_modules/vant/lib/image-preview/ImagePreviewItem.js
generated
vendored
Normal file
@ -0,0 +1,261 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _shared = require("./shared");
|
||||
|
||||
var _number = require("../utils/format/number");
|
||||
|
||||
var _event = require("../utils/dom/event");
|
||||
|
||||
var _touch = require("../mixins/touch");
|
||||
|
||||
var _image = _interopRequireDefault(require("../image"));
|
||||
|
||||
var _loading = _interopRequireDefault(require("../loading"));
|
||||
|
||||
var _swipeItem = _interopRequireDefault(require("../swipe-item"));
|
||||
|
||||
// Utils
|
||||
// Mixins
|
||||
// Component
|
||||
function getDistance(touches) {
|
||||
return Math.sqrt(Math.pow(touches[0].clientX - touches[1].clientX, 2) + Math.pow(touches[0].clientY - touches[1].clientY, 2));
|
||||
}
|
||||
|
||||
var _default = {
|
||||
mixins: [_touch.TouchMixin],
|
||||
props: {
|
||||
src: String,
|
||||
show: Boolean,
|
||||
active: Number,
|
||||
minZoom: [Number, String],
|
||||
maxZoom: [Number, String],
|
||||
rootWidth: Number,
|
||||
rootHeight: Number
|
||||
},
|
||||
data: function data() {
|
||||
return {
|
||||
scale: 1,
|
||||
moveX: 0,
|
||||
moveY: 0,
|
||||
moving: false,
|
||||
zooming: false,
|
||||
imageRatio: 0,
|
||||
displayWidth: 0,
|
||||
displayHeight: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
vertical: function vertical() {
|
||||
var rootWidth = this.rootWidth,
|
||||
rootHeight = this.rootHeight;
|
||||
var rootRatio = rootHeight / rootWidth;
|
||||
return this.imageRatio > rootRatio;
|
||||
},
|
||||
imageStyle: function imageStyle() {
|
||||
var scale = this.scale;
|
||||
var style = {
|
||||
transitionDuration: this.zooming || this.moving ? '0s' : '.3s'
|
||||
};
|
||||
|
||||
if (scale !== 1) {
|
||||
var offsetX = this.moveX / scale;
|
||||
var offsetY = this.moveY / scale;
|
||||
style.transform = "scale(" + scale + ", " + scale + ") translate(" + offsetX + "px, " + offsetY + "px)";
|
||||
}
|
||||
|
||||
return style;
|
||||
},
|
||||
maxMoveX: function maxMoveX() {
|
||||
if (this.imageRatio) {
|
||||
var displayWidth = this.vertical ? this.rootHeight / this.imageRatio : this.rootWidth;
|
||||
return Math.max(0, (this.scale * displayWidth - this.rootWidth) / 2);
|
||||
}
|
||||
|
||||
return 0;
|
||||
},
|
||||
maxMoveY: function maxMoveY() {
|
||||
if (this.imageRatio) {
|
||||
var displayHeight = this.vertical ? this.rootHeight : this.rootWidth * this.imageRatio;
|
||||
return Math.max(0, (this.scale * displayHeight - this.rootHeight) / 2);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
active: 'resetScale',
|
||||
show: function show(val) {
|
||||
if (!val) {
|
||||
this.resetScale();
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted: function mounted() {
|
||||
this.bindTouchEvent(this.$el);
|
||||
},
|
||||
methods: {
|
||||
resetScale: function resetScale() {
|
||||
this.setScale(1);
|
||||
this.moveX = 0;
|
||||
this.moveY = 0;
|
||||
},
|
||||
setScale: function setScale(scale) {
|
||||
scale = (0, _number.range)(scale, +this.minZoom, +this.maxZoom);
|
||||
|
||||
if (scale !== this.scale) {
|
||||
this.scale = scale;
|
||||
this.$emit('scale', {
|
||||
scale: this.scale,
|
||||
index: this.active
|
||||
});
|
||||
}
|
||||
},
|
||||
toggleScale: function toggleScale() {
|
||||
var scale = this.scale > 1 ? 1 : 2;
|
||||
this.setScale(scale);
|
||||
this.moveX = 0;
|
||||
this.moveY = 0;
|
||||
},
|
||||
onTouchStart: function onTouchStart(event) {
|
||||
var touches = event.touches;
|
||||
var _this$offsetX = this.offsetX,
|
||||
offsetX = _this$offsetX === void 0 ? 0 : _this$offsetX;
|
||||
this.touchStart(event);
|
||||
this.touchStartTime = new Date();
|
||||
this.fingerNum = touches.length;
|
||||
this.startMoveX = this.moveX;
|
||||
this.startMoveY = this.moveY;
|
||||
this.moving = this.fingerNum === 1 && this.scale !== 1;
|
||||
this.zooming = this.fingerNum === 2 && !offsetX;
|
||||
|
||||
if (this.zooming) {
|
||||
this.startScale = this.scale;
|
||||
this.startDistance = getDistance(event.touches);
|
||||
}
|
||||
},
|
||||
onTouchMove: function onTouchMove(event) {
|
||||
var touches = event.touches;
|
||||
this.touchMove(event);
|
||||
|
||||
if (this.moving || this.zooming) {
|
||||
(0, _event.preventDefault)(event, true);
|
||||
}
|
||||
|
||||
if (this.moving) {
|
||||
var moveX = this.deltaX + this.startMoveX;
|
||||
var moveY = this.deltaY + this.startMoveY;
|
||||
this.moveX = (0, _number.range)(moveX, -this.maxMoveX, this.maxMoveX);
|
||||
this.moveY = (0, _number.range)(moveY, -this.maxMoveY, this.maxMoveY);
|
||||
}
|
||||
|
||||
if (this.zooming && touches.length === 2) {
|
||||
var distance = getDistance(touches);
|
||||
var scale = this.startScale * distance / this.startDistance;
|
||||
this.setScale(scale);
|
||||
}
|
||||
},
|
||||
onTouchEnd: function onTouchEnd(event) {
|
||||
var stopPropagation = false;
|
||||
/* istanbul ignore else */
|
||||
|
||||
if (this.moving || this.zooming) {
|
||||
stopPropagation = true;
|
||||
|
||||
if (this.moving && this.startMoveX === this.moveX && this.startMoveY === this.moveY) {
|
||||
stopPropagation = false;
|
||||
}
|
||||
|
||||
if (!event.touches.length) {
|
||||
if (this.zooming) {
|
||||
this.moveX = (0, _number.range)(this.moveX, -this.maxMoveX, this.maxMoveX);
|
||||
this.moveY = (0, _number.range)(this.moveY, -this.maxMoveY, this.maxMoveY);
|
||||
this.zooming = false;
|
||||
}
|
||||
|
||||
this.moving = false;
|
||||
this.startMoveX = 0;
|
||||
this.startMoveY = 0;
|
||||
this.startScale = 1;
|
||||
|
||||
if (this.scale < 1) {
|
||||
this.resetScale();
|
||||
}
|
||||
}
|
||||
} // eliminate tap delay on safari
|
||||
|
||||
|
||||
(0, _event.preventDefault)(event, stopPropagation);
|
||||
this.checkTap();
|
||||
this.resetTouchStatus();
|
||||
},
|
||||
checkTap: function checkTap() {
|
||||
var _this = this;
|
||||
|
||||
if (this.fingerNum > 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
var _this$offsetX2 = this.offsetX,
|
||||
offsetX = _this$offsetX2 === void 0 ? 0 : _this$offsetX2,
|
||||
_this$offsetY = this.offsetY,
|
||||
offsetY = _this$offsetY === void 0 ? 0 : _this$offsetY;
|
||||
var deltaTime = new Date() - this.touchStartTime;
|
||||
var TAP_TIME = 250;
|
||||
var TAP_OFFSET = 5;
|
||||
|
||||
if (offsetX < TAP_OFFSET && offsetY < TAP_OFFSET && deltaTime < TAP_TIME) {
|
||||
if (this.doubleTapTimer) {
|
||||
clearTimeout(this.doubleTapTimer);
|
||||
this.doubleTapTimer = null;
|
||||
this.toggleScale();
|
||||
} else {
|
||||
this.doubleTapTimer = setTimeout(function () {
|
||||
_this.$emit('close');
|
||||
|
||||
_this.doubleTapTimer = null;
|
||||
}, TAP_TIME);
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad: function onLoad(event) {
|
||||
var _event$target = event.target,
|
||||
naturalWidth = _event$target.naturalWidth,
|
||||
naturalHeight = _event$target.naturalHeight;
|
||||
this.imageRatio = naturalHeight / naturalWidth;
|
||||
}
|
||||
},
|
||||
render: function render() {
|
||||
var h = arguments[0];
|
||||
var imageSlots = {
|
||||
loading: function loading() {
|
||||
return h(_loading.default, {
|
||||
"attrs": {
|
||||
"type": "spinner"
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
return h(_swipeItem.default, {
|
||||
"class": (0, _shared.bem)('swipe-item')
|
||||
}, [h(_image.default, {
|
||||
"attrs": {
|
||||
"src": this.src,
|
||||
"fit": "contain"
|
||||
},
|
||||
"class": (0, _shared.bem)('image', {
|
||||
vertical: this.vertical
|
||||
}),
|
||||
"style": this.imageStyle,
|
||||
"scopedSlots": imageSlots,
|
||||
"on": {
|
||||
"load": this.onLoad
|
||||
}
|
||||
})]);
|
||||
}
|
||||
};
|
||||
exports.default = _default;
|
1
node_modules/vant/lib/image-preview/index.css
generated
vendored
Normal file
1
node_modules/vant/lib/image-preview/index.css
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
.van-image-preview{position:fixed;top:0;left:0;width:100%;height:100%}.van-image-preview__swipe{height:100%}.van-image-preview__swipe-item{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;overflow:hidden}.van-image-preview__cover{position:absolute;top:0;left:0}.van-image-preview__image{width:100%;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform}.van-image-preview__image--vertical{width:auto;height:100%}.van-image-preview__image img{-webkit-user-drag:none}.van-image-preview__image .van-image__error{top:30%;height:40%}.van-image-preview__image .van-image__error-icon{font-size:36px}.van-image-preview__image .van-image__loading{background-color:transparent}.van-image-preview__index{position:absolute;top:16px;left:50%;color:#fff;font-size:14px;line-height:20px;text-shadow:0 1px 1px #323233;-webkit-transform:translate(-50%,0);transform:translate(-50%,0)}.van-image-preview__overlay{background-color:rgba(0,0,0,.9)}.van-image-preview__close-icon{position:absolute;z-index:1;color:#c8c9cc;font-size:22px;cursor:pointer}.van-image-preview__close-icon:active{color:#969799}.van-image-preview__close-icon--top-left{top:16px;left:16px}.van-image-preview__close-icon--top-right{top:16px;right:16px}.van-image-preview__close-icon--bottom-left{bottom:16px;left:16px}.van-image-preview__close-icon--bottom-right{right:16px;bottom:16px}
|
98
node_modules/vant/lib/image-preview/index.js
generated
vendored
Normal file
98
node_modules/vant/lib/image-preview/index.js
generated
vendored
Normal file
@ -0,0 +1,98 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
||||
|
||||
var _vue = _interopRequireDefault(require("vue"));
|
||||
|
||||
var _ImagePreview = _interopRequireDefault(require("./ImagePreview"));
|
||||
|
||||
var _utils = require("../utils");
|
||||
|
||||
var instance;
|
||||
var defaultConfig = {
|
||||
loop: true,
|
||||
value: true,
|
||||
images: [],
|
||||
maxZoom: 3,
|
||||
minZoom: 1 / 3,
|
||||
onClose: null,
|
||||
onChange: null,
|
||||
className: '',
|
||||
showIndex: true,
|
||||
closeable: false,
|
||||
closeIcon: 'clear',
|
||||
asyncClose: false,
|
||||
transition: 'van-fade',
|
||||
getContainer: 'body',
|
||||
overlayStyle: null,
|
||||
startPosition: 0,
|
||||
swipeDuration: 300,
|
||||
showIndicators: false,
|
||||
closeOnPopstate: true,
|
||||
closeIconPosition: 'top-right'
|
||||
};
|
||||
|
||||
var initInstance = function initInstance() {
|
||||
instance = new (_vue.default.extend(_ImagePreview.default))({
|
||||
el: document.createElement('div')
|
||||
});
|
||||
document.body.appendChild(instance.$el);
|
||||
instance.$on('change', function (index) {
|
||||
if (instance.onChange) {
|
||||
instance.onChange(index);
|
||||
}
|
||||
});
|
||||
instance.$on('scale', function (data) {
|
||||
if (instance.onScale) {
|
||||
instance.onScale(data);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var ImagePreview = function ImagePreview(images, startPosition) {
|
||||
if (startPosition === void 0) {
|
||||
startPosition = 0;
|
||||
}
|
||||
|
||||
/* istanbul ignore if */
|
||||
if (_utils.isServer) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!instance) {
|
||||
initInstance();
|
||||
}
|
||||
|
||||
var options = Array.isArray(images) ? {
|
||||
images: images,
|
||||
startPosition: startPosition
|
||||
} : images;
|
||||
(0, _extends2.default)(instance, defaultConfig, options);
|
||||
instance.$once('input', function (show) {
|
||||
instance.value = show;
|
||||
});
|
||||
instance.$once('closed', function () {
|
||||
instance.images = [];
|
||||
});
|
||||
|
||||
if (options.onClose) {
|
||||
instance.$off('close');
|
||||
instance.$once('close', options.onClose);
|
||||
}
|
||||
|
||||
return instance;
|
||||
};
|
||||
|
||||
ImagePreview.Component = _ImagePreview.default;
|
||||
|
||||
ImagePreview.install = function () {
|
||||
_vue.default.use(_ImagePreview.default);
|
||||
};
|
||||
|
||||
var _default = ImagePreview;
|
||||
exports.default = _default;
|
103
node_modules/vant/lib/image-preview/index.less
generated
vendored
Normal file
103
node_modules/vant/lib/image-preview/index.less
generated
vendored
Normal file
@ -0,0 +1,103 @@
|
||||
@import '../style/var';
|
||||
|
||||
.van-image-preview {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
&__swipe {
|
||||
height: 100%;
|
||||
|
||||
&-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
&__cover {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
&__image {
|
||||
width: 100%;
|
||||
transition-property: transform;
|
||||
|
||||
&--vertical {
|
||||
width: auto;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
img {
|
||||
// disable desktop browser image drag
|
||||
-webkit-user-drag: none;
|
||||
}
|
||||
|
||||
.van-image {
|
||||
&__error {
|
||||
top: 30%;
|
||||
height: 40%;
|
||||
}
|
||||
|
||||
&__error-icon {
|
||||
font-size: 36px;
|
||||
}
|
||||
|
||||
&__loading {
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__index {
|
||||
position: absolute;
|
||||
top: @padding-md;
|
||||
left: 50%;
|
||||
color: @image-preview-index-text-color;
|
||||
font-size: @image-preview-index-font-size;
|
||||
line-height: @image-preview-index-line-height;
|
||||
text-shadow: @image-preview-index-text-shadow;
|
||||
transform: translate(-50%, 0);
|
||||
}
|
||||
|
||||
&__overlay {
|
||||
background-color: @image-preview-overlay-background-color;
|
||||
}
|
||||
|
||||
&__close-icon {
|
||||
position: absolute;
|
||||
z-index: @image-preview-close-icon-z-index;
|
||||
color: @image-preview-close-icon-color;
|
||||
font-size: @image-preview-close-icon-size;
|
||||
cursor: pointer;
|
||||
|
||||
&:active {
|
||||
color: @image-preview-close-icon-active-color;
|
||||
}
|
||||
|
||||
&--top-left {
|
||||
top: @image-preview-close-icon-margin;
|
||||
left: @image-preview-close-icon-margin;
|
||||
}
|
||||
|
||||
&--top-right {
|
||||
top: @image-preview-close-icon-margin;
|
||||
right: @image-preview-close-icon-margin;
|
||||
}
|
||||
|
||||
&--bottom-left {
|
||||
bottom: @image-preview-close-icon-margin;
|
||||
left: @image-preview-close-icon-margin;
|
||||
}
|
||||
|
||||
&--bottom-right {
|
||||
right: @image-preview-close-icon-margin;
|
||||
bottom: @image-preview-close-icon-margin;
|
||||
}
|
||||
}
|
||||
}
|
13
node_modules/vant/lib/image-preview/shared.js
generated
vendored
Normal file
13
node_modules/vant/lib/image-preview/shared.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.bem = exports.createComponent = void 0;
|
||||
|
||||
var _utils = require("../utils");
|
||||
|
||||
var _createNamespace = (0, _utils.createNamespace)('image-preview'),
|
||||
createComponent = _createNamespace[0],
|
||||
bem = _createNamespace[1];
|
||||
|
||||
exports.bem = bem;
|
||||
exports.createComponent = createComponent;
|
10
node_modules/vant/lib/image-preview/style/index.js
generated
vendored
Normal file
10
node_modules/vant/lib/image-preview/style/index.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
require('../../style/base.css');
|
||||
require('../../overlay/index.css');
|
||||
require('../../info/index.css');
|
||||
require('../../icon/index.css');
|
||||
require('../../image/index.css');
|
||||
require('../../popup/index.css');
|
||||
require('../../loading/index.css');
|
||||
require('../../swipe/index.css');
|
||||
require('../../swipe-item/index.css');
|
||||
require('../index.css');
|
10
node_modules/vant/lib/image-preview/style/less.js
generated
vendored
Normal file
10
node_modules/vant/lib/image-preview/style/less.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
require('../../style/base.less');
|
||||
require('../../overlay/index.less');
|
||||
require('../../info/index.less');
|
||||
require('../../icon/index.less');
|
||||
require('../../image/index.less');
|
||||
require('../../popup/index.less');
|
||||
require('../../loading/index.less');
|
||||
require('../../swipe/index.less');
|
||||
require('../../swipe-item/index.less');
|
||||
require('../index.less');
|
Reference in New Issue
Block a user