<script>
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://vuejs.org/api/sfc-script-setup.html#script-setup
import Greet from "./components/Greet.vue";
import AppHyperSpectral from "./AppHyperSpectral.vue";
import APPDataview from "./DataView/APPDataview.vue";
import EventBus from "./eventBus.js";
export default {
  components: {
    Greet,
    AppHyperSpectral,
    APPDataview
  },
  data() {
    return {
      modalcomponent: 'AppHyperSpectral',
      compomentlist: ['AppHyperSpectral', 'APPDataview'],
      indexofcomponent: 0,
    };
  },
  mounted() {
   EventBus.on('changemainvue', this.onchangemainvue);
   console.log(window.__TAURI__);

  },
  methods: {
    onchangemainvue(){
      this.indexofcomponent++;
      if (this.indexofcomponent >= this.compomentlist.length) {
        this.indexofcomponent = 0;
      }
      this.modalcomponent = this.compomentlist[this.indexofcomponent];


    }
    
  }
};
</script>

<template>
 <component :is="modalcomponent" ref="Commancompent" style="user-select: none;"></component>
    
</template>

<style scoped>

</style>
