index.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <u-cell :isLink="isLink" :arrow-direction="arrowDirection" :border="border" :center="center">
  3. <view slot="value" class="cell_wrap">
  4. <view v-if="val" class="dictLabel">{{ val }}</view>
  5. <view v-else class="placeholder">请选择</view>
  6. <view v-if="isDelete && val" @click.stop="clear()">
  7. <u-icon size="15" name="close-circle"></u-icon>
  8. </view>
  9. </view>
  10. </u-cell>
  11. </template>
  12. <script>
  13. export default {
  14. name: 'CustomCell',
  15. data() {
  16. return {}
  17. },
  18. props: {
  19. isLink: {
  20. type: Boolean,
  21. default: true,
  22. },
  23. arrowDirection: {
  24. type: String,
  25. default: 'right',
  26. },
  27. border: {
  28. type: Boolean,
  29. default: false,
  30. },
  31. center: {
  32. type: Boolean,
  33. default: true,
  34. },
  35. val: {
  36. type: String,
  37. default: '',
  38. },
  39. isDelete: {
  40. type: Boolean,
  41. default: false,
  42. },
  43. },
  44. emits: ['handleClear'],
  45. methods: {
  46. clear(){
  47. this.$emit('handleClear');
  48. }
  49. }
  50. }
  51. </script>
  52. <style scoped>
  53. @import './index.scss';
  54. </style>