index.vue 700 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <view class="hc-sys-box" :class="[tabbar ? 'is-tabbar' : '', ui]">
  3. <hc-nav-bar id="hc-nav-bar" :ui="navBarUi" v-if="isNavBars">
  4. <slot name="navBar"></slot>
  5. </hc-nav-bar>
  6. <slot></slot>
  7. <hc-tabbar v-if="tabbar"/>
  8. </view>
  9. </template>
  10. <script setup>
  11. import {ref, watch} from "vue";
  12. const props = defineProps({
  13. ui: String,
  14. tabbar: Boolean,
  15. navBarUi: String,
  16. isNavBar: {
  17. type: Boolean,
  18. default: true
  19. }
  20. });
  21. const isNavBars = ref(props.isNavBar)
  22. //监听
  23. watch(() => [
  24. props.isNavBar,
  25. ], ([val]) => {
  26. isNavBars.value = val
  27. })
  28. </script>
  29. <style scoped lang="scss">
  30. @import "./style.scss";
  31. </style>