<template>
    <up-cell :isLink="isLink" :arrow-direction="arrowDirection" :border="border" :center="center" :stop="stop">
        <template #value>
            <view class="cell_wrap">
                <view v-if="val" class="dictLabel">{{ val }}</view>
                <view v-else class="placeholder">请选择</view>
                <view v-if="isDelete && val" @click.stop="clear()">
                    <up-icon size="15" name="close-circle"></up-icon>
                </view>
            </view>
        </template>
    </up-cell>
</template>

<script>
export default {
  name: 'CustomCell',
  data() {
    return {}
  },
  props: {
    isLink: {
      type: Boolean,
      default: true,
    },
    arrowDirection: {
      type: String,
      default: 'right',
    },
    border: {
      type: Boolean,
      default: false,
    },
    center: {
      type: Boolean,
      default: true,
    },
    val: {
      type: String,
      default: '',
    },
    isDelete: {
        type: Boolean,
        default: false,
    },
    // 为 false 时点击不阻止冒泡，便于外层 up-form-item 的 @click 能触发（如品牌/鉴定人员/回收人员/回收时间）
    stop: {
        type: Boolean,
        default: true,
    },
  },
  emits: ['handleClear'],
  methods: {
    clear(){
      this.$emit('handleClear');
    }
  }
}
</script>
<style scoped>
@import './index.scss';
</style>
