App.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <div id="app" style="{background:'#002976'}">
  3. <header-view class="headerView"></header-view>
  4. <router-view class="content" />
  5. </div>
  6. </template>
  7. <script>
  8. import headerView from './components/SD-school/header-view'
  9. export default {
  10. components:{headerView},
  11. data() {
  12. return {
  13. resizeTime: true,
  14. };
  15. },
  16. mounted() {
  17. this.getWeater()
  18. window.addEventListener("resize", () => this.resizeTimeActions(), true);
  19. },
  20. methods: {
  21. resizeTimeActions() {
  22. if (!this.resizeTime) return;
  23. this.resizeTime = false;
  24. setTimeout(() => {
  25. this.resizeTime = true;
  26. this.$store.commit("changClient", document.documentElement.clientWidth + document.documentElement.clientHeight);
  27. }, 300);
  28. },
  29. async getWeater(){
  30. // let res = await this.$axios.get('/top/listWeather?'+this.$qs.stringify({ area: '上海市' }))
  31. // if(res.success){
  32. // this.$store.commit("changWeater", res.data.showapi_res_body.now);
  33. // }
  34. }
  35. },
  36. };
  37. </script>
  38. <style lang="scss">
  39. #app {
  40. width: 100%;
  41. height: 100%;
  42. background: url('./assets/image/bg.png') no-repeat;
  43. background-size: 100% 100%;
  44. color: #fff;
  45. display: flex;
  46. flex-direction: column;
  47. .content{
  48. width: 100%;
  49. height: calc(100% - 60px);
  50. }
  51. .content-AF{
  52. width: 100%;
  53. height: calc(100% - 85px);
  54. padding-bottom: 0px;
  55. }
  56. .headerView{
  57. width: 100%;
  58. height: 60px;
  59. }
  60. .headerView-af{
  61. width: 100%;
  62. height: 85px;
  63. }
  64. }
  65. </style>