<!--  -->
<template>
  <div>
    <div class="title">
      <div class="title-h1">
        <h1>{{ titleName }}</h1>
      </div>
      <div class="title-button" v-if="false">
        <el-button
          class="button"
          v-if="!buttonshow"
          size="small"
          type="primary"
          @click="SetTourl(1)"
          >Home</el-button
        >
        <el-button
          class="button"
          v-if="buttonshow"
          size="small"
          type="primary"
          @click="OutLgoin"
          >退出登录</el-button
        >
      </div>
      <div class="title-time" v-if="true">
        {{ time }}
      </div>
    </div>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';
export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  data() {
    //这里存放数据
    return {
      showtitle: false,
      buttonshow: false,
      time: "2021-3-19 15:30:29",
      titlelist: [
        "智能环卫体验管理中心",
        "智能环保体验管理中心",
        "智能XX体验管理中心",
      ],
    };
  },
  props: {
    titleName: String,
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {},
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {
    window.setInterval(() => {
      this.time =
        "星期" +
        "日一二三四五六".charAt(new Date().getDay()) +
        " " +
        new Date().toLocaleString();
    }, 100);
  },
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style scoped>
.title {
  position: fixed;
  top: 0vh;
  left: 0vw;
  z-index: 9999999;
  width: 100vw;
  height: 8vh;
  /* background-color: #fb7418; */
  background-image: linear-gradient(
    to top,
    rgba(77, 123, 234, 0) 0%,
    rgba(77, 123, 234, 0.4) 50%,
    rgba(77, 123, 234, 0) 100%
  );
}
.title-h1 {
  text-align: center;
  position: fixed;
  top: 0vh;
  left: 0vw;
  width: 100vw;
  height: 8vh;
  z-index: 9999999;
  font-size: 2vh;
  color: #fff;
  line-height: 2.5vh;
  margin: 0;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 0 #cccccc, 0 6px 1px rgba(77, 123, 234, 0.1),
    0 0 5px rgba(77, 123, 234, 0.1), 0 1px 3px rgba(77, 123, 234, 0.3),
    0 3px 5px rgba(77, 123, 234, 0.2), 0 5px 10px rgba(77, 123, 234, 0.25),
    0 10px 10px rgba(77, 123, 234, 0.2), 0 20px 20px rgba(77, 123, 234, 0.15);
}
.title-time {
  color: #fff;
  font-size: 1.5vh;
  position: fixed;
  top: 3vh;
  left: 2vw;
  width: 100vw;
  height: 8vh;
  z-index: 9999;
}
.title-button {
  position: fixed;
  top: 2.5vh;
  left: 93vw;
  width: 100vw;
  height: 8vh;
  z-index: 9999999;
}
.button {
  font-size: 1.3vh;
  font-weight: 900;
  padding: 1vh 0.5vw;
  width: 5vw;
  background-color: rgba(0, 0, 0, 0.3);
  outline-style: none;
  border: none;
  border-radius: 15px;
  box-shadow: 0px 0px 5px rgb(77, 123, 234, 1);
  transition: all 0.4s;
}
.button:hover {
  background-color: rgba(0, 0, 0, 0.3);
  box-shadow: 0px 0px 15px rgb(77, 123, 234, 1);
}
</style>
