210新增自动报警弹框提示,历史记录页面功能
This commit is contained in:
@ -22,9 +22,17 @@
|
||||
<text v-if="rightText" :style="{ color: rightColor }" @click="handleRightClick">
|
||||
{{ rightText }}
|
||||
</text>
|
||||
<!-- 显示多个图标 -->
|
||||
<template v-if="rightIcons && rightIcons.length > 0">
|
||||
<image v-for="(icon, index) in rightIcons" :key="index" :src="icon.src"
|
||||
@click="handleIconClick(index)" class="pathIMG" :style="{
|
||||
width: icon.size || '40rpx',
|
||||
height: icon.size || '40rpx',
|
||||
marginLeft: index > 0 ? '20rpx' : '0'
|
||||
}" />
|
||||
</template>
|
||||
<!-- 或显示图标 -->
|
||||
<image v-if="rightIcon" :src="rightIcon" @click="handleRightClick" mode=""
|
||||
class="pathIMG">
|
||||
<image v-if="rightIcon" :src="rightIcon" @click="handleRightClick" class="pathIMG">
|
||||
</image>
|
||||
</slot>
|
||||
</view>
|
||||
@ -60,6 +68,11 @@
|
||||
rightIconSize: { // 图标大小
|
||||
type: Number,
|
||||
default: 24
|
||||
},
|
||||
rightIcons: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
// 格式: [{src: '/path/icon1.png'}, {src: '/path/icon2.png'}]
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -76,6 +89,10 @@
|
||||
},
|
||||
handleRightClick() {
|
||||
this.$emit('right-click'); // 触发右侧点击事件
|
||||
},
|
||||
// 新增图标点击方法
|
||||
handleIconClick(index) {
|
||||
this.$emit('icon-click', index)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user