Skip to content
加载中...

T-Image 图片

兼容端

安卓苹果Web鸿蒙微信小程序

使用示例

vue
<template>
    <t-image src="/static/logo.png"></t-image>
    <t-image :ma="['5px','0','0','0']" width="70" height="70" src="/static/logo.png"></t-image>
</template>

属性

属性名类型默认值说明
srcString""图片链接
modeString"aspectFill"图片模式,可选值:scaleToFill/aspectFit/aspectFill/widthFix/heightFix/top/bottom/center/left/right/top left/top right/bottom left/bottom right
widthString"50"宽度
heightString"50"高度
roundArray<string>[]圆角,格式:[水平半径, 垂直半径] 或 [左上, 右上, 右下, 左下]
lazyLoadBooleantrue懒加载
fadeShowBooleantrue加载动画效果
webpBooleantruewebp格式支持
showMenuByLongpressBooleantrue微信小程序长按菜单
draggableBooleanfalseH5端是否允许拖动图片
maArray<string>[]外边距,格式:[垂直, 水平] 或 [上, 右, 下, 左]
paArray<string>[]内边距,格式:[垂直, 水平] 或 [上, 右, 下, 左]
previewBooleanfalse是否开启图片预览功能

方法

方法名说明参数
click图片点击事件Event
error图片加载错误事件Event
load图片加载完成事件Event

插槽

插槽名说明
该组件暂无插槽