Commit 2c8549c5aa612b715aa3ac631f2ab07bcb7ab891

Authored by 王强
1 parent bf0a3ea7

1、App.vue格式整理

2、优选库——优选页面监听visibilitychange事件
src/App.vue
1 1 <template>
2   - <div id="app">
3   - <router-view></router-view>
4   - </div>
  2 + <div id="app">
  3 + <router-view></router-view>
  4 + </div>
5 5 </template>
6 6  
7 7 <script>
8   - export default {
9   - name: "App"
10   - };
  8 + export default {
  9 + name: "App"
  10 + };
11 11 </script>
12 12  
13 13 <style rel="stylesheet/less" lang="less">
14   - .mint-toast-text{
  14 + .mint-toast-text {
15 15 font-size: 30px !important;
16 16 }
17 17 .mint-indicator-text {
18 18 font-size: 30px !important;
19 19 }
20 20 -</style>
  21 +</style>
21 22 \ No newline at end of file
... ...
src/pages/optimization2/optimization2.vue
... ... @@ -632,6 +632,17 @@
632 632 });
633 633 }
634 634 }
  635 +
  636 + // 页面显示监听
  637 + document.addEventListener('visibilitychange', () => {
  638 +
  639 + // 页面显示出来了
  640 + if (document.hidden === false) {
  641 +
  642 + // 优选页面接口
  643 + this.index();
  644 + }
  645 + });
635 646 }
636 647 }
637 648 </script>
... ...