<template> <view class="exhibit-recommend"> <view class="exhibit-list"> <template v-for="(item, index) in [1, 2, 3, 4]"> <view class="exhibit-item" hover-class="active" :key="index" @click="onClickExhibit(item)"> <view class="exhibit-image"> <image src="https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da70b4f4b0.png?x-oss-process=image/resize,w_400" mode="aspectFit"/> </view> <view class="exhibit-name">汽车连接器 86W MLK 1,2 SD-HOLDER</view> <view class="exhibit-tag">常规产品</view> </view> </template> </view> </view> </template> <script> export default { options: { styleIsolation: 'shared' }, components: { }, data() { return { } }, created() { }, methods: { onClickExhibit() { this.navigateTo('/pages/exhibitor/exhibit-detail') } } } </script> <style lang="scss"> .exhibit-recommend{ .exhibit-list{ display: grid; grid-template-columns: 1fr 1fr; grid-column-gap: 18rpx; grid-row-gap: 30rpx; .exhibit-item{ position: relative; &.active{ .exhibit-tag{ background-color: #FCEDE1; color: #E57519; } .exhibit-name{ color: #E57519; } .exhibit-image{ border: 1rpx solid #E57519; } } } .exhibit-image{ width: 100%; height: 178rpx; border: 1rpx solid #D9D9D9; image{ width: 100%; height: 100%; } } .exhibit-name { font-family: Poppins, Poppins; font-size: $fontSize0; color: #333333; margin-top: 12rpx; } .exhibit-tag{ position: absolute; top: 20rpx; left: 31rpx; font-size: 10rpx; color: #333333; background-color: #E2E8F0; border-radius: 4rpx; padding: 5rpx 8rpx; } } } </style>