<template>
  <div id="app" :class="[isIosX?'iosXH':'',isiOS?'ios':'',isXcx?'xcx':'']">
    <keep-alive>
      <router-view v-if="$route.meta.keepAlive"></router-view>
    </keep-alive> 
    <router-view v-if="!$route.meta.keepAlive"></router-view>
    <!-- <router-view></router-view> -->
  </div>
</template>

<script>
export default {
  name: 'app',
  components: {
  },
  computed:{
    isIosX(){
      return window.isIosX || false;
    },
    isiOS() {
      return window.isiOS || false;
    },
    isXcx() {
      return window.isxcx || 0;
    }
  },
  mounted(){
    window.localStorage.setItem('isxcx',0);
    window.isxcx=0;
    window.topheight=(1.35*setRootSize()).toFixed(2);
    window.bottomheight=(1.4*setRootSize()).toFixed(2);
    window.winheight=document.documentElement.clientHeight-bottomheight-topheight

    if (!window.WeixinJSBridge || !window.WeixinJSBridge.invoke) {
      document.addEventListener('WeixinJSBridgeReady', ready, false)
    } else {
      ready()
    }

    function ready(){
      if(window.__wxjs_environment === 'miniprogram') {
        window.localStorage.setItem('isxcx',1);
        window.isxcx=1;
      } else {
        window.localStorage.setItem('isxcx',0);
        window.isxcx=0;
      }
    }
 
  }
}
</script>

<style>

</style>
