<script setup>
import DemoApp from "../DemoHomepage/App.vue";
import ActivityApp from "../MetroWidgetDemos/PerformanceTest/App.vue"; // TODO
import { jJsvRuntimeBridge } from "jsview";
import { ref, onMounted } from "vue";

const getShowMode = () => {
  let showMode = 0;
  // showMode信息可被URL中的?后缀信息替换
  if (window.location.search.indexOf("showMode=0") >= 0) {
    showMode = 0;
  } else if (window.location.search.indexOf("showMode=1") >= 0) {
    showMode = 1;
  }

  return showMode;
};

const showMode = ref(getShowMode());

onMounted(() => {
  jJsvRuntimeBridge.notifyPageLoaded();
});
</script>

<template>
  <DemoApp v-if="showMode === 0" />
  <ActivityApp v-else-if="showMode === 1" />
</template>