<template>
    <u-cell :isLink="isLink" :arrow-direction="arrowDirection" :border="border" :center="center">
        <view slot="value" 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()">
                <u-icon size="15" name="close-circle"></u-icon>
            </view>
        </view>
    </u-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,
    },

  },
  emits: ['handleClear'],
  methods: {
    clear(){
      this.$emit('handleClear');
    }
  }
}
</script>
<style scoped>
@import './index.scss';
</style>
