index.vue 520 B

123456789101112131415161718192021222324252627282930313233
  1. <template>
  2. <view class="hc-nav-bar-box" :class="ui">
  3. <view class="hc-nav-bar" v-if="isNavBar">
  4. <slot></slot>
  5. </view>
  6. </view>
  7. </template>
  8. <script setup>
  9. import {ref, watch} from "vue";
  10. const props = defineProps({
  11. ui: String,
  12. isShow: {
  13. type: Boolean,
  14. default: true
  15. }
  16. });
  17. //判断是否显示
  18. const isNavBar = ref(props.isShow)
  19. //监听表头
  20. watch(() => [
  21. props.isShow
  22. ], ([show]) => {
  23. isNavBar.value = show
  24. })
  25. </script>
  26. <style scoped lang="scss">
  27. @import "./style.scss";
  28. </style>