<template> <div> <el-row> <el-col :span="8" class="el-col" :class="{'BorderActive':isActive===1}" > <div > <img src="/img/map/basemap.png" @click="selectMap(1)"> <div class="zi-ti" :class="{'Zi-tiActive':isActive===1}">基础地形图</div> </div> </el-col> <el-col :span="8" class="el-col" :class="{'BorderActive':isActive===2}"> <div > <img src="/img/map/sallite.png" @click="selectMap(2)"> <div class="zi-ti" :class="{'Zi-tiActive':isActive===2}">基础影像底图</div> </div> </el-col> <el-col :span="8" class="el-col" :class="{'BorderActive':isActive===3}" > <div> <img src="/img/map/basemap.png" @click="selectMap(3)"> <div class="zi-ti" :class="{'Zi-tiActive':isActive===3}">基础底图</div> </div> </el-col> </el-row> </div> </template> <script lang="ts"> import {Component, Vue} from 'vue-property-decorator'; @Component export default class BaseMap extends Vue { isActive:number=1; selectMap(isActive: number){ this.isActive=isActive; } } </script> <style scoped> .el-col{ 93px; height: 65px; border: 1px solid #D4D4D4; margin-top: 12px; margin-left: 5px; border-radius: 4px; background-color: #FFFFFF; } img{ 78%; } .zi-ti{ font-size: 15px; } .BorderActive{ border-color: #0066FF; } .Zi-tiActive{ color: #0066FF; } </style>