DESKTOP-QATJ4FN\Administrator
2022-10-31 74555b20fb93491ee3761df8aeb1082e15a9c36c
1031
4 files modified
61 ■■■■■ changed files
config/index.js 2 ●●● patch | view | raw | blame | history
src/App.vue 55 ●●●●● patch | view | raw | blame | history
src/page/home/home.vue 2 ●●● patch | view | raw | blame | history
src/router/index.js 2 ●●● patch | view | raw | blame | history
config/index.js
@@ -24,7 +24,7 @@
    },
    // Various Dev Server settings
    host: '0.0.0.0', // can be overwritten by process.env.HOST
    host: 'localhost', // can be overwritten by process.env.HOST
    port: 80, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
    autoOpenBrowser: true,
    errorOverlay: true,
src/App.vue
@@ -4,7 +4,7 @@
      <mt-header :title="title">
        <mt-button icon="back" slot="left" @click="$router.go(-1)"></mt-button>
        <template v-if="iconRight == 'search'">
          <img slot="right" class="search-right" src="./assets/ico/fangdajing.png" alt="">
          <img slot="right" class="search-right" src="./assets/ico/fangdajing.png" alt />
        </template>
        <template v-else>
          <mt-button icon="more" slot="right"></mt-button>
@@ -12,56 +12,64 @@
      </mt-header>
    </div>
    <div class="body-box">
      <transition
        :duration="1000"
        mode="out-in"
        appear
        enter-active-class="animated fadeInRight"
        leave-active-class="animated fadeOut"
        appear-active-class="animated zoomInDown"
      >
      <router-view></router-view>
      </transition>
    </div>
  </div>
</template>
<script>
export default {
  name: 'App',
  name: "App",
  created () {
    let title = this.$route.meta.title || '首页'
    this.title = title
    let title = this.$route.meta.title || "首页";
    this.title = title;
    if (this.$route.meta.hasHeader) {
      this.hasHeader = true
      this.hasHeader = true;
    } else{
      this.hasHeader = false
      this.hasHeader = false;
    }
    if (this.$route.meta.iconRight) {
      this.iconRight = this.$route.meta.iconRight
      this.iconRight = this.$route.meta.iconRight;
    } else{
      this.iconRight = 'default'
      this.iconRight = "default";
    }
    // this.$store.state.className = window.localStorage.getItem('styleName')?window.localStorage.getItem('styleName'):'red'
  },
  watch: {
    $route(val) {
      let title = val.meta.title || '首页'
      this.title = title
      let title = val.meta.title || "首页";
      this.title = title;
      if (val.meta.iconRight) {
        this.iconRight = val.meta.iconRight
        this.iconRight = val.meta.iconRight;
      } else{
        this.iconRight = 'default'
        this.iconRight = "default";
      }
      if (val.meta.hasHeader) {
        this.hasHeader = true
        this.hasHeader = true;
      } else{
        this.hasHeader = false
        this.hasHeader = false;
      }
    }
  },
  data() {
    return {
      title: '首页',
      title: "首页",
      hasHeader: false,
      iconRight:'default'
      iconRight: "default"
    };
    }
  }
}
};
</script>
<style lang="less" scoped>
@@ -69,7 +77,7 @@
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: 'rubik';
  font-family: "rubik";
    .header-box{
      width: 100%;
      height: 1rem;
@@ -85,7 +93,6 @@
          font-size: 0.36rem;
          color:rgba(255,255,255,1);
        }
      }
      button{
        outline: none;
@@ -98,7 +105,7 @@
      overflow-y: auto;
    }
    &.red-theme{
      background: #E9E9E9;
    background: #e9e9e9;
      /deep/.mint-header{
        background: none;
        .mint-header-title{
@@ -116,8 +123,8 @@
    }
  }
  .search-right {
    width: .3rem;
    height: .3rem;
  width: 0.3rem;
  height: 0.3rem;
  }
.mint-search-list{
    position: relative !important;
src/page/home/home.vue
@@ -143,7 +143,7 @@
    <!-- tab -->
    <GoToLogin />
    <foot></foot>
    <!-- <foot></foot> -->
  </div>
</template>
src/router/index.js
@@ -120,7 +120,7 @@
      meta: {
        title: '行情',
        requireAuth: false,
        hasHeader: true
        hasHeader: false
      },
      component: List
    }, {