123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <template>
- <view class="u-des-row" :class="{'border': border, 'click': isCilck}" @click="$emit('click')">
- <slot name="left" />
- <view class="label">
- {{label}}
- </view>
- <view class="value">
- <slot name="value" :isOpen="isOpen">
- {{value}}
- </slot>
- </view>
- <!-- -->
- <view class="right-icon" v-if="forward">
- <uni-icons type="forward" size="12" color="#9FA5BA" />
- </view>
- <view class="right-icon" v-else-if="eye" @click="isOpen=!isOpen">
- <image v-if="isOpen" src="/static/open_icon.png" style="width: 28rpx;height: 20rpx;" mode=""></image>
- <image v-else src="/static/no_open.png" style="width: 28rpx;height: 11rpx;" mode=""></image>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: "u-des-row",
- props: {
- label: {
- type: [String, Number],
- default: ''
- },
- value: {
- type: [String, Number],
- default: ''
- },
- border: {
- type: Boolean,
- default: false
- },
- forward: { // 向右箭头
- type: Boolean,
- default: false
- },
- eye: { // 眼睛 可视?
- type: Boolean,
- default: false
- },
- },
- data() {
- return {
- isOpen: false
- }
- },
- computed: {
- isCilck() {
- return Boolean(this.$listeners['click'])
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .u-des-row {
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: 100rpx;
- &.border {
- border-bottom: 1px solid #F5F7FA;
- }
- &.click {
- cursor: pointer;
- &:hover {
- background: #F5F7FA;
- }
- }
- .label {
- font-size: 28rpx;
- margin-right: 16rpx;
- color: #333333;
- font-weight: bold;
- }
- .value {
- flex: 1;
- text-align: right;
- font-size: 28rpx;
- font-weight: 400;
- color: #333333;
- //超过一行省略号 one-line
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .right-icon {
- height: 36rpx;
- width: 36rpx;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- cursor: pointer;
- }
- }
- </style>
|