| | |
| | | <view class="dropdown-container" :style="{ '--theme-color': themeColor }"> |
| | | <!-- 触发按钮 --> |
| | | <view class="dropdown-trigger" @click="toggleDropdown"> |
| | | <uni-icons type="more-filled" size="20" color="#666"></uni-icons> |
| | | <uni-icons type="more-filled" size="20" color="#fff"></uni-icons> |
| | | <view class="dropdown-icon" :class="{ 'rotate': isOpen }"> |
| | | <uni-icons type="arrowdown" size="16" color="#666"></uni-icons> |
| | | <uni-icons type="arrowdown" size="16" color="#fff"></uni-icons> |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | export default { |
| | | name: 'DropdownMenu', |
| | | props: { |
| | | // 业务数据,选中菜单后一同返回 |
| | | data: { |
| | | type: Object |
| | | }, |
| | | // 选项列表 |
| | | options: { |
| | | type: Array, |
| | |
| | | // 根据配置返回整个对象或value值 |
| | | const emitValue = typeof item === 'object' ? item[this.valueKey] : item |
| | | this.$emit('input', emitValue) |
| | | this.$emit('change', emitValue) |
| | | this.$emit('change', emitValue, this.data) |
| | | } |
| | | } |
| | | } |
| | |
| | | height: 70rpx; |
| | | line-height: 70rpx; |
| | | border-radius: 8rpx; |
| | | background-color: #fff; |
| | | // background-color: #fff; |
| | | box-sizing: border-box; |
| | | cursor: pointer; |
| | | |