index.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <up-cell :isLink="isLink" :arrow-direction="arrowDirection" :border="border" :center="center" :stop="stop">
  3. <template #value>
  4. <view class="cell_wrap">
  5. <view v-if="val" class="dictLabel">{{ val }}</view>
  6. <view v-else class="placeholder">请选择</view>
  7. <view v-if="isDelete && val" @click.stop="clear()">
  8. <up-icon size="15" name="close-circle"></up-icon>
  9. </view>
  10. </view>
  11. </template>
  12. </up-cell>
  13. </template>
  14. <script>
  15. export default {
  16. name: 'CustomCell',
  17. data() {
  18. return {}
  19. },
  20. props: {
  21. isLink: {
  22. type: Boolean,
  23. default: true,
  24. },
  25. arrowDirection: {
  26. type: String,
  27. default: 'right',
  28. },
  29. border: {
  30. type: Boolean,
  31. default: false,
  32. },
  33. center: {
  34. type: Boolean,
  35. default: true,
  36. },
  37. val: {
  38. type: String,
  39. default: '',
  40. },
  41. isDelete: {
  42. type: Boolean,
  43. default: false,
  44. },
  45. // 为 false 时点击不阻止冒泡,便于外层 up-form-item 的 @click 能触发(如品牌/鉴定人员/回收人员/回收时间)
  46. stop: {
  47. type: Boolean,
  48. default: true,
  49. },
  50. },
  51. emits: ['handleClear'],
  52. methods: {
  53. clear(){
  54. this.$emit('handleClear');
  55. }
  56. }
  57. }
  58. </script>
  59. <style scoped>
  60. @import './index.scss';
  61. </style>