uni-navbar.vue 831 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <u-navbar :title="title" @leftClick="leftClick" :autoBack="false" leftIconColor="#FFFFFF" :placeholder="true"
  3. bgColor="rgba(0,0,0,0)" :leftIconSize="leftIconSize">
  4. </u-navbar>
  5. </template>
  6. <script>
  7. export default {
  8. props: {
  9. title: {
  10. type: String,
  11. default: "",
  12. },
  13. leftIconSize: {
  14. type: String,
  15. default: "",
  16. },
  17. path: {
  18. type: String,
  19. default: "",
  20. }
  21. },
  22. data() {
  23. return {
  24. }
  25. },
  26. methods: {
  27. leftClick() {
  28. if (this.leftIconSize === "0") {
  29. return false;
  30. }
  31. if (this.path) {
  32. this.$tab.navigateTo(this.path)
  33. } else {
  34. this.$tab.navigateBack()
  35. }
  36. }
  37. },
  38. }
  39. </script>
  40. <style lang="scss" scoped>
  41. // 导航栏字的样式
  42. /deep/ .u-navbar__content__title {
  43. color: #FFFFFF;
  44. font-size: 36rpx;
  45. font-weight: bold;
  46. }
  47. </style>