index.vue 958 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. <!--检测升级-->
  9. <hc-update/>
  10. </view>
  11. </template>
  12. <script setup>
  13. import {onMounted, ref, watch} from "vue";
  14. const props = defineProps({
  15. ui: String,
  16. tabbar: Boolean,
  17. navBarUi: String,
  18. isNavBar: {
  19. type: Boolean,
  20. default: true
  21. }
  22. });
  23. const isNavBars = ref(props.isNavBar)
  24. //监听
  25. watch(() => [
  26. props.isNavBar,
  27. ], ([val]) => {
  28. isNavBars.value = val
  29. })
  30. //渲染完成
  31. onMounted(() => {
  32. //监听用户截屏事件
  33. // #ifdef APP-PLUS
  34. uni.onUserCaptureScreen((path) => {
  35. console.log('用户截屏了', path)
  36. });
  37. // #endif
  38. })
  39. </script>
  40. <style scoped lang="scss">
  41. @import "./style.scss";
  42. </style>