BeeLocale.vue 1019 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <view class="bee-locale-container" @click="$jump(`/pages/choose-address/choose-address?eventName=${eventName}`)">
  3. <slot>
  4. <tui-icon v-if="isIcon" :size="size" name="gps" color="#ffffff"></tui-icon>
  5. <BeeIcon v-else :src="require('./locale.png')" :size="size"></BeeIcon>
  6. <view class="location-text">
  7. <text :style="{ 'fontSize': size * 2 + 'upx' }">{{ $store.getters[field] }}</text>
  8. </view>
  9. </slot>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. name: 'BeeLocale',
  15. props: {
  16. isIcon: {
  17. type: Boolean,
  18. default: false
  19. },
  20. size: {
  21. type: Number,
  22. default: 16
  23. },
  24. field: {
  25. type: String,
  26. default: 'currentCity'
  27. },
  28. eventName: {
  29. type: String,
  30. default: ''
  31. }
  32. }
  33. }
  34. </script>
  35. <style lang="less" scoped>
  36. .bee-locale-container {
  37. display: flex;
  38. align-items: center;
  39. margin-right: 10upx;
  40. .location-text {
  41. flex: 1;
  42. // width: 0;
  43. max-width: 38vw;
  44. margin-left: 4upx;
  45. white-space: nowrap;
  46. overflow: hidden;
  47. text-overflow: ellipsis;
  48. }
  49. }
  50. </style>