App.vue 1.88 KB
<template>
  <div id="app">
    <!-- <div id="nav">
      <router-link to="/">Home</router-link> |
      <router-link to="/about">About</router-link>
    </div>-->
    <router-view />
  </div>
</template>

<script>
import { setWaterMark } from "@/utils/watermark";

export default {
  name: "App",
  data() {
    return {};
  },
  methods: {
    /**
     * 192.168.3.2:8080
     * 显示测试服水印
     * 1、根据kd的环境
     * host中含dev或者sandbox的为测试环境
     * 2、VUE_APP_WATER_MARK设置为true
     */
    initWaterMark() {
      let host = location.host;
      if (
        process.env.VUE_APP_WATER_MARK &&
        (host.indexOf("dev") != -1 || host.indexOf("sandbox") != -1)
      ) {
        setWaterMark("测试服", "");
      }
    },
  },
  mounted() {
    console.log("111");
    this.initWaterMark();
  },
};
</script>

<style lang="scss">
#app {
  /* font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px; */
  border: 0;
  margin: 0;
  padding: 0;
}

body,
div {
  border: 0;
  margin: 0;
  padding: 0;
}

.app__width {
  width: 750px;
}

.app__inner {
  margin: 20px;
}

.app__title {
  font-size: $fontSize;
  line-height: $fontSize + 4px;
  font-weight: bold;
  padding-bottom: 10px;
  margin-bottom: 20px;
  border-bottom: 0.5px solid #eeeeee;
}

.app__desc {
  font-size: $fontSizeSmaller;
  line-height: $fontSizeSmaller + 2px;
  margin-bottom: 20px;
  color: $colorGray;
}

.app__bgc {
  position: fixed;
  background-color: #ffffff;
  width: 100%;
  height: 100%;
}

.app__bg {
  position: absolute;
  width: 100%;
  height: 100%;
}

.app__top-shadow {
  position: fixed;
  width: 750px;
  height: 1px;
  box-shadow: 0px 4px 0.9px 0.1px rgba(6, 0, 1, 0.07);
  background-color: #ffffff;
}

.app__content {
  position: relative;
}
</style>