<template>
  <!-- <div id="app">
    <router-view v-if="isRouterAlive"></router-view>
  </div>-->
  <div id="app">
    <keep-alive>
      <router-view v-if="$route.meta.keepAlive"></router-view>
    </keep-alive>
    <router-view v-if="!$route.meta.keepAlive"></router-view>
  </div>
</template>

<script>
import login from "./components/login";
import home from "./components/home/home";
import examine from "./components/examine/examine";
import newmessage from "./components/newmessage/newmessage";
import knowmore from "./components/knowmore/knowmore";
import system from "./components/system/system";
import Site from "./components/Site/Site";
import crop from "./components/crop/crop";
import discern from "./components/discern/discern";
import person from "./components/person/person";
import secondstep from "./components/secondstep/secondstep";
import injuriousInsect from "./components/injuriousInsect/injuriousInsect";
import knowledge from "./components/knowledge/knowledge";
import disease from "./components/disease/disease";
import pathology from "./components/pathology/pathology";
import provinceList from "./components/provinceList/provinceList";
import cityList from "./components/cityList/cityList";
import particulars from "./components/particulars/particulars";
import cropType from "./components/cropType/cropType";
import cNumber from "./components/cNumber/cNumber";
import county from "./components/county/county";
import countryside from "./components/countryside/countryside";
import entering from "./components/entering/entering";
import insect from "./components/insect/insect";
import caste from "./components/caste/caste";
import kunName from "./components/kunName/kunName";
import shengList from "./components/shengList/shengList";
import shiList from "./components/shiList/shiList";
import xianList from "./components/xianList/xianList";
import insectType from "./components/insectType/insectType";
import bottomNav from "./components/bottomNav/bottomNav";
import goTop from "./components/goTop/goTop";
import lianxi from "./components/lianxi/lianxi";
import help from "./components/help/help";
import feedback from "./components/feedback/feedback";
import feedback_list from "./components/feedback_list/feedback_list";
import record from "./components/record/record";
import details from "./components/details/details";
import library from "./components/library/library";
import inventory from "./components/inventory/inventory";
import lianxiD from "./components/lianxi/lianxiD";
import upload_pictures from "./components/upload_pictures/upload_pictures";
import statistics from "./components/statistics/statistics";
import addData from "./components/addData/addData";
import updateHistory from "./components/updateHistory/updateHistory";
import screen_plant from "./components/screen_plant/screen_plant";
import plantset from "./components/plantset/plantset";
import insectset from "./components/insectset/insectset";
import plantinsectset from "./components/plantinsectset/plantinsectset";
import acquiescent from "./components/acquiescent/acquiescent";
import plantPlug from "./components/plantPlug/plantPlug";
import insectPlug from "./components/insectPlug/insectPlug";
import headStyle from "./components/headStyle/headStyle";

export default {
  name: "app",
  components: {
    login,
    home,
    examine,
    newmessage,
    knowmore,
    system,
    Site,
    crop,
    discern,
    person,
    secondstep,
    injuriousInsect,
    knowledge,
    disease,
    pathology,
    provinceList,
    cityList,
    particulars,
    cropType,
    cNumber,
    county,
    countryside,
    entering,
    insect,
    caste,
    kunName,
    shengList,
    shiList,
    xianList,
    insectType,
    bottomNav,
    goTop,
    lianxi,
    help,
    feedback,
    feedback_list,
    record,
    details,
    library,
    inventory,
    lianxiD,
    upload_pictures,
    statistics,
    addData,
    updateHistory,
    screen_plant,
    plantset,
    insectset,
    plantinsectset,
    acquiescent,
    plantPlug,
    insectPlug,
    headStyle
  },
  provide() {
    return {
      reload: this.reload
    };
  },
  data() {
    return {
      isRouterAlive: true
    };
  },
  methods: {
    reload() {
      this.isRouterAlive = false;
      this.$nextTick(function() {
        this.isRouterAlive = true;
      });
    }
  }
};
</script>

<style scoped lang="scss">
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  // color: #2c3e50;
  height: 100%;
}
</style>
