miniprogram-demo/pages/component/image/image.js

52 lines
1.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

Page({
onShareAppMessage() {
return {
title: 'image',
path: 'pages/component/image/image'
}
},
data: {
imageUrl: 'https://nextcloud.finogeeks.club/s/dkNKAkzfypy9Y5k/preview',
webpImageURL: 'https://nextcloud.finogeeks.club/s/8TdNyfsqBzM5QJP/preview',
src: "https://nextcloud.finogeeks.club/s/RBymS8FA27RMiCs/preview",
array: [{
mode: 'scaleToFill',
text: 'scaleToFill不保持纵横比缩放图片使图片完全适应'
}, {
mode: 'aspectFit',
text: 'aspectFit保持纵横比缩放图片使图片的长边能完全显示出来'
}, {
mode: 'aspectFill',
text: 'aspectFill保持纵横比缩放图片只保证图片的短边能完全显示出来'
}, {
mode: 'top',
text: 'top不缩放图片只显示图片的顶部区域'
}, {
mode: 'bottom',
text: 'bottom不缩放图片只显示图片的底部区域'
}, {
mode: 'center',
text: 'center不缩放图片只显示图片的中间区域'
}, {
mode: 'left',
text: 'left不缩放图片只显示图片的左边区域'
}, {
mode: 'right',
text: 'right不缩放图片只显示图片的右边边区域'
}, {
mode: 'top left',
text: 'top left不缩放图片只显示图片的左上边区域'
}, {
mode: 'top right',
text: 'top right不缩放图片只显示图片的右上边区域'
}, {
mode: 'bottom left',
text: 'bottom left不缩放图片只显示图片的左下边区域'
}, {
mode: 'bottom right',
text: 'bottom right不缩放图片只显示图片的右下边区域'
}]
}
})