index.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <u-navbar :title="title" placeholder class="custom_nav_bar">
  3. <template slot="left">
  4. <slot name="left">
  5. <view class="u-nav-slot">
  6. <image
  7. @click="leftClick"
  8. class="back_icon"
  9. src="../../static/images/common_left_arrow.png"
  10. style="width: 12px;height: 20px;"
  11. alt=""
  12. srcset=""
  13. />
  14. </view>
  15. </slot>
  16. </template>
  17. <template slot="center">
  18. <slot name="center"></slot>
  19. </template>
  20. <template slot="right">
  21. <slot name="more">
  22. <view @click="rightClick" v-if="more" class="u-nav-slot">
  23. <u-icon class="more_dot" name="more-dot-fill" size="23" color="#0C1C33"></u-icon>
  24. </view>
  25. </slot>
  26. </template>
  27. </u-navbar>
  28. </template>
  29. <script>
  30. export default {
  31. name: '',
  32. components: {},
  33. props: {
  34. title: {
  35. type: String
  36. },
  37. more: {
  38. type: Boolean,
  39. default: false
  40. },
  41. route: {
  42. type: Boolean,
  43. default: true
  44. }
  45. },
  46. data() {
  47. return {};
  48. },
  49. methods: {
  50. leftClick() {
  51. if (this.route) {
  52. uni.navigateBack();
  53. }
  54. this.$emit('leftClick');
  55. },
  56. rightClick() {
  57. this.$emit('rightClick');
  58. }
  59. }
  60. };
  61. </script>
  62. <style lang="scss" scoped>
  63. .custom_nav_bar {
  64. /deep/ .u-navbar__content__left {
  65. padding: 0;
  66. }
  67. /deep/ .u-navbar__content__right {
  68. padding: 0;
  69. }
  70. .back_icon {
  71. padding: 24rpx;
  72. margin-left: 20rpx;
  73. width: 12px;
  74. height: 20px;
  75. }
  76. .more_dot {
  77. padding: 24rpx;
  78. margin-right: 20rpx;
  79. }
  80. }
  81. </style>