index.vue 918 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <u-navbar v-bind="__attrs" v-on="__listeners">
  3. <!-- 通用的插槽,todo #right="slotData" 这样写不显示,原因不详 -->
  4. <!-- <template #[name] v-for="(_, name) in $scopedSlots">
  5. <slot :name="name"></slot>
  6. </template>-->
  7. <!--默认展示right -->
  8. <template #right v-if="!$scopedSlots.right">
  9. <msg-tips></msg-tips>
  10. </template>
  11. </u-navbar>
  12. </template>
  13. <script>
  14. import uProps from 'uview-ui/components/u-navbar/props';
  15. import msgTips from '@/pages/home/msgTips';
  16. export default {
  17. name: 'index',
  18. components: {
  19. msgTips,
  20. },
  21. props: {
  22. ...uProps,
  23. },
  24. computed: {
  25. __attrs() {
  26. return {
  27. placeholder: true, // 固定在顶部时,是否生成一个等高元素,以防止塌陷
  28. autoBack: true,
  29. ...this.$props,
  30. ...this.$attrs,
  31. };
  32. },
  33. __listeners() {
  34. return {
  35. ...this.$listeners,
  36. };
  37. },
  38. },
  39. };
  40. </script>
  41. <style scoped lang="scss"></style>