nav-bar.vue 483 B

12345678910111213141516171819202122232425262728293031323334
  1. <template>
  2. <div class="navbar">
  3. <van-nav-bar
  4. :title="title"
  5. left-arrow
  6. @click-left="$emit('click-left')"
  7. />
  8. <slot></slot>
  9. </div>
  10. </template>
  11. <script>
  12. export default {
  13. props: {
  14. title: {
  15. type: String,
  16. default: () => ''
  17. }
  18. }
  19. }
  20. </script>
  21. <style lang="scss" scoped>
  22. .navbar {
  23. @include position-sticky(66);
  24. }
  25. ::v-deep .van-nav-bar {
  26. position: sticky;
  27. top: 0;
  28. }
  29. ::v-deep .van-nav-bar .van-icon {
  30. color: #333333;
  31. }
  32. </style>