index.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <view :class="['form_select_to_page', borderType]" @click="handleClickToPage">
  3. <view>{{ val }}</view>
  4. <view @click.stop="clear" v-if="val && isDelete">
  5. <u-icon size="13" name="close-circle"></u-icon>
  6. </view>
  7. <u-icon size="20" name="arrow-right"></u-icon>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. components: {
  13. },
  14. props: {
  15. val: {
  16. type: String || Number,
  17. default: '' || null,
  18. },
  19. url: {
  20. type: String,
  21. default: '',
  22. },
  23. isDelete: {
  24. type: Boolean,
  25. default: false,
  26. },
  27. borderType: {
  28. type: String,
  29. default: 'none',//none,bottom
  30. }
  31. },
  32. emits: ['handleClear'],
  33. data() {
  34. return {
  35. }
  36. },
  37. methods: {
  38. clear(){
  39. console.log(this.val);
  40. this.$emit('handleClear');
  41. },
  42. handleClickToPage(){
  43. uni.navigateTo({
  44. url: this.url
  45. })
  46. }
  47. }
  48. }
  49. </script>
  50. <style lang="scss" scoped>
  51. @import './index.scss';
  52. </style>