index.vue 1.4 KB

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