抖音小程序发布平台
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 

124 рядки
2.9 KiB

  1. <template>
  2. <div id="app">
  3. <router-view v-if="isRouterAlive"></router-view>
  4. </div>
  5. </template>
  6. <script>
  7. import { mapState, mapActions } from "vuex";
  8. export default {
  9. name: 'App',
  10. provide(){
  11. return{
  12. reload: this.reload
  13. }
  14. },
  15. data () {
  16. return {
  17. isRouterAlive:true
  18. }
  19. },
  20. methods:{
  21. ...mapActions(["setIndex"]),
  22. reload () {
  23. this.isRouterAlive = false
  24. this.$nextTick(function(){
  25. this.isRouterAlive =true
  26. })
  27. }
  28. },
  29. computed: {
  30. //当前导航状态
  31. ...mapState({
  32. topNav: state => state.topNav.data, //将 this.topNav 映射为 this.$store.topNav.data
  33. index: state => state.topNav.index,
  34. })
  35. },
  36. // created() {
  37. // //在页面加载时读取sessionStorage里的状态信息
  38. // if (sessionStorage.getItem("index")) {
  39. // this.setIndex(JSON.parse(sessionStorage.getItem("index")))
  40. // }
  41. // //在页面刷新时将vuex里的信息保存到sessionStorage里
  42. // window.addEventListener("beforeunload", () => {
  43. // sessionStorage.setItem("index", JSON.stringify(this.index));
  44. // })
  45. // },
  46. }
  47. </script>
  48. <style>
  49. @import url('../node_modules/bootstrap/dist/css/bootstrap.min.css');
  50. .fl{float: left;}
  51. .fr{float: right;}
  52. .clearfix:after {
  53. content: ".";
  54. display: block;
  55. height: 0;
  56. clear: both;
  57. visibility: hidden;
  58. }
  59. h1, h2 {
  60. font-weight: normal;
  61. }
  62. ul {
  63. list-style-type: none;
  64. padding: 0;
  65. }
  66. li {
  67. display: inline-block;
  68. margin: 0 10px;
  69. }
  70. a {
  71. color: #42b983;
  72. text-decoration: none;
  73. }
  74. #app {
  75. font-family: 'Avenir', Helvetica, Arial, sans-serif;
  76. -webkit-font-smoothing: antialiased;
  77. -moz-osx-font-smoothing: grayscale;
  78. text-align: center;
  79. color: #2c3e50;
  80. position: relative;
  81. }
  82. body::-webkit-scrollbar {
  83. width: 8px;
  84. height: 8px;
  85. }
  86. /*正常情况下滑块的样式*/
  87. body::-webkit-scrollbar-thumb {
  88. background-color: rgba(0,0,0,.05);
  89. border-radius: 10px;
  90. -webkit-box-shadow: inset 1px 1px 0 rgba(0,0,0,.3);
  91. }
  92. /*鼠标悬浮在该类指向的控件上时滑块的样式*/
  93. body:hover::-webkit-scrollbar-thumb {
  94. background-color: rgba(0,0,0,.2);
  95. border-radius: 10px;
  96. -webkit-box-shadow: inset 1px 1px 0 rgba(0,0,0,.1);
  97. }
  98. /*鼠标悬浮在滑块上时滑块的样式*/
  99. body::-webkit-scrollbar-thumb:hover {
  100. background-color: rgba(0,0,0,.4);
  101. -webkit-box-shadow: inset 1px 1px 0 rgba(0,0,0,.1);
  102. }
  103. /*正常时候的主干部分*/
  104. body::-webkit-scrollbar-track {
  105. border-radius: 10px;
  106. -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0);
  107. background-color: white;
  108. }
  109. /*鼠标悬浮在滚动条上的主干部分*/
  110. body::-webkit-scrollbar-track:hover {
  111. -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.4);
  112. background-color: rgba(0,0,0,.01);
  113. }
  114. .insight,.production,.server,.about,.case,.partner,.copy{
  115. width: 100%;
  116. position: relative;
  117. }
  118. </style>