<template>
  <div class="container">
    <div class="contain">
      <Header></Header>
      <Desktop :defaultZIndex="defaultZIndex"></Desktop>
      <DesktopAppView :defaultZIndex="defaultZIndex"></DesktopAppView>
    </div>
  </div>
</template>

<script>
import Header from "./component/Header";
import Desktop from "./component/Desktop";
import DesktopAppView from "./component/DesktopAppView";

import { getCurrentInstance } from "vue";
import mitt from "mitt";
export default {
  data() {
    return {
      defaultZIndex: 9053,
    };
  },
  beforeCreate() {
    const ins = getCurrentInstance();
    ins.appContext.config.globalProperties.$bus = mitt();
  },
  mounted(){
    this.$bus.on('changeDefaultZIndex',this.changeDefaultZIndex)
  },
  methods:{
    // 改变公共zIndex
    changeDefaultZIndex(zIndex){
      if(this.defaultZIndex > 999999990){
        this.defaultZIndex = 999999990
      }
      this.defaultZIndex = zIndex
    },
  },
  components: {
    Header,
    Desktop,
    DesktopAppView,
  },
};
</script>

<style lang="">

</style>
