3 changed files with 181 additions and 40 deletions
-
24src/components/MoneyManage/CurrencySelect.vue
-
121src/components/MoneyManage/ProductSelect.vue
-
24src/views/moneyManage/receiveDetail/receiveDetail.vue
@ -0,0 +1,121 @@ |
|||
<template> |
|||
<div class="productContent"> |
|||
<div class="selectBox" @click="handelMenu" :class="{ 'active': isOpen }"> |
|||
<span class="placeholder" :style="{ color: selectedItem ? '#333' : '#A8ABB2' }"> |
|||
{{ selectedItem || placeholder }} |
|||
</span> |
|||
<span class="arrow"> |
|||
<el-icon> |
|||
<ArrowDown /> |
|||
</el-icon> |
|||
</span> |
|||
</div> |
|||
|
|||
<div class="menu" v-show="isOpen"> |
|||
<div class="coin"> |
|||
<div class="coinselect"> |
|||
coin1 |
|||
<span class="coin-arrow"> |
|||
<el-icon> |
|||
<ArrowDown /> |
|||
</el-icon> |
|||
</span> |
|||
</div> |
|||
<div class="coinoption"> |
|||
coIn2 |
|||
</div> |
|||
</div> |
|||
<div class="product"> |
|||
22 |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
<script setup> |
|||
import { ref, computed, watchEffect, onMounted } from 'vue'; |
|||
const searchData = ref('') |
|||
const isOpen = ref(false) |
|||
const selectedItem = ref('') |
|||
const dropdownRef = ref(null) |
|||
const placeholder = ref('请选择产品') |
|||
|
|||
const handelMenu = () => { |
|||
isOpen.value = !isOpen.value |
|||
} |
|||
</script> |
|||
<style scoped lang="scss"> |
|||
.productContent { |
|||
position: relative; |
|||
width: 268px; |
|||
font-family: 'Arial', sans-serif; |
|||
} |
|||
|
|||
.selectBox { |
|||
border: 1px solid #e5e7eb; |
|||
padding: 4px 12px; |
|||
/* 调整内边距以匹配按钮高度 */ |
|||
height: 23px; |
|||
/* 调整高度以匹配按钮 */ |
|||
cursor: pointer; |
|||
display: flex; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
background-color: #fff; |
|||
border-radius: 6px; |
|||
transition: all 0.3s ease; |
|||
|
|||
.placeholder { |
|||
flex: 1; |
|||
font-size: 14px; |
|||
line-height: 18px; |
|||
color: #A8ABB2; |
|||
} |
|||
} |
|||
|
|||
// 箭头图标:展开时旋转 |
|||
.arrow { |
|||
margin-left: 8px; |
|||
color: #999; |
|||
transition: transform 0.3s ease; |
|||
} |
|||
|
|||
.selectBox.active .arrow { |
|||
transform: rotate(180deg); |
|||
} |
|||
|
|||
.menu { |
|||
position: absolute; |
|||
top: 100%; // 紧贴触发器下方 |
|||
left: 0; |
|||
width: 130%; |
|||
max-height: 600px; |
|||
display: flex; |
|||
padding: 10px; |
|||
flex-direction: column; |
|||
align-items: flex-start; |
|||
gap: 10px; |
|||
flex-shrink: 0; |
|||
border-radius: 8px; |
|||
background: #E4F0FC; |
|||
box-shadow: 0 0 4px 0 #00000040; |
|||
z-index: 100; |
|||
|
|||
|
|||
.coin { |
|||
width: 100%; |
|||
|
|||
.coinselect { |
|||
width: 100px; |
|||
height: 30px; |
|||
border: 1px solid #175BE5; |
|||
padding: 5px 0 5px 12px; |
|||
display: flex; |
|||
|
|||
.coin-arrow { |
|||
margin-top: 8px; |
|||
color: #111; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue