Browse Source

change image show

tags/v1.2.0
zhangtao 1 year ago
parent
commit
a70175621c
2 changed files with 9 additions and 4 deletions
  1. +3
    -3
      src/layout/components/Header/index.vue
  2. +6
    -1
      src/views/dashboard/components/Extend.vue

+ 3
- 3
src/layout/components/Header/index.vue View File

display: flex; display: flex;
align-items: center; align-items: center;
.header__scroll{ .header__scroll{
width: 150px;
width: 250px;
margin-right: 50px; margin-right: 50px;
position: relative; position: relative;
} }
.scroll__content{ .scroll__content{
width: 150px;
width: 250px;
height: 30px; height: 30px;
overflow: hidden; overflow: hidden;
position: absolute; position: absolute;
transition: all .5s; transition: all .5s;
} }
li{ li{
width: 150px;
width: 250px;
line-height: 30px; line-height: 30px;
color: rgba(255,255,255,1); color: rgba(255,255,255,1);
cursor: pointer; cursor: pointer;

+ 6
- 1
src/views/dashboard/components/Extend.vue View File

<template> <template>
<div class="map__entend"> <div class="map__entend">
<div v-for="(item,index) in extendList" :key="index" class="extend__container" @click="handleClick(index)"> <div v-for="(item,index) in extendList" :key="index" class="extend__container" @click="handleClick(index)">
<img :src="selectedTab === index ? `/src/assets/images/${item.selected.path}.png` : `/src/assets/images/${item.path}.png`" alt="">
<img :src="selectedTab === index ? getImgUrl(item.selected.path) : getImgUrl(item.path)" alt="">
<p :style="{color: selectedTab === index ? item.selected.color : '#eee'}">{{ item.name }}</p> <p :style="{color: selectedTab === index ? item.selected.color : '#eee'}">{{ item.name }}</p>
</div> </div>


}) })
} }


const getImgUrl = (src) => {
return new URL(`../../../assets/images/${src}.png`, import.meta.url).href
}

return { return {
...toRefs(data), ...toRefs(data),
...toRefs(warn), ...toRefs(warn),
handleDateChange, handleDateChange,
handleWarnChange, handleWarnChange,
handleQuesChange, handleQuesChange,
getImgUrl,
handlePositiveClick(row) { handlePositiveClick(row) {
$message.info('机场设备开始自检,请稍等') $message.info('机场设备开始自检,请稍等')
implement(row.id).then((res) => { implement(row.id).then((res) => {

Loading…
Cancel
Save