Image 图片:基本使用
基本使用,参考API<template><view class="index"><u-image width="700rpx" height="300rpx" :src="src"></u-image></view></template><script>export default {data() {return
·
基本使用
<template>
<view class="index">
<u-image width="700rpx" height="300rpx" :src="src"></u-image>
</view>
</template>
<script>
export default {
data() {
return {
src: 'https://cdn.uviewui.com/uview/swiper/1.jpg'
}
},
}
</script>
懒加载
注意:此功能只对微信小程序、App、百度小程序、字节跳动小程序有效,默认开启。
<u-image src="https://cdn.uviewui.com/uview/example/fade.jpg" :lazy-load="true"></u-image>
图片形状
通过 shape 参数设置图片的形状,circle为圆形,square为方形
如果为方形时,还可以通过border-radius参数设置圆角值
<u-image src="https://cdn.uviewui.com/uview/example/fade.jpg" shape="circle"></u-image>
填充模式
mode 有 14 种模式,其中 5 种是缩放模式,9 种是裁剪模式。
更多推荐
已为社区贡献3条内容
所有评论(0)