App.vue 1.17 KB
<template>
  <div id="app">
    <keep-alive include="aiCard">
      <router-view />
    </keep-alive>
  </div>
</template>

<script>
export default {
  name: 'report-app',
  props: {
    msg: String,
    message: String
  },
  data() {
    return {
      myMsg: '',
      gs: ''
    }
  },
  watch: {
    $route(to) {
      document.querySelector('.el-main .el-scrollbar__wrap').scrollTo(0, 0)
    }
  },
  beforeDestroy() {
    document.onkeydown = function() {
      return true
    }
  },
  created() {
    document.onkeydown = function() {
      var evt = window.event || arguments[0]
      if (evt && evt.keyCode == 13) {
        if (typeof evt.cancelBubble != 'undefined') evt.cancelBubble = true
        if (typeof evt.stopPropagation == 'function') evt.stopPropagation()
        return false
      }
      return true
    }
    this.myMsg = this.msg
    this.myMessage = this.message
  }
}
</script>

<style lang="scss">
.parent-child-communication {
  padding: 20px 0;
  line-height: 36px;
}
#app {
  background: #f4f5fa;
  padding: 0px 20px 20px 40px;
  position: absolute;
  box-sizing: border-box;
  width: 100%;
  top: 0px;
  left: 0px;
  overflow-y: auto;
  height: 100%;
}
</style>