【chromeDownload】自定义组件:多用于登录框底部提供下载Chrome谷歌浏览器的链接

chromeDownload

html 复制代码
<template>
  <div :class="$options.name" :styleType="styleType">
    <el-divider />
    <div class="chrome-text">
      <div class="left">推荐使用先进的浏览器</div>
      <div class="right">
        <div class="left">
          <img src="~@/../static/img/login/chrome.svg" />
        </div>
        <div class="right">
          <p>谷歌浏览器</p>
          <p>Google Chrome</p>
        </div>
      </div>
    </div>
    <div class="chrome-download-link">
      <el-tag size="mini" @click="download(0)">官网下载</el-tag>
      <el-tag size="mini" @click="download(1)">下载在线安装包</el-tag>
      <el-tag size="mini" @click="download(2)">下载离线安装包</el-tag>
    </div>
  </div>
</template>
<script>
export default {
  name: `chromeDownload`,
  components: {},
  data() {
    return {
      visible: false,
      form: {},
      styleType: null,

      links: [
        `https://www.google.cn/chrome`,
        `https://www.wedoyun.cn/share/software/ChromeSetup.exe`,
        `https://www.wedoyun.cn/share/software/ChromeStandaloneSetup64.exe`,
      ],
    };
  },

  props: [`value`, `data`],

  watch: {
    data: {
      handler(newValue, oldValue) {
        //console.log(`深度监听${this.$options.name}:`, newValue, oldValue);
        if (Object.keys(newValue || {}).length) {
          this.form = this.$g.deepCopy(newValue);
          this.$g.cF2CP(`styleType`, this);
        }
      },
      deep: true,
      immediate: true,
    },
  },
  created() {},
  mounted() {},
  beforeDestroy() {},
  methods: {
    download(type) {
      this.$g.go2RouterPath(
        {
          path: this.links[type],
          query: {},
          target: `_blank`,
        },
        this
      );
    },
  },
};
</script>
<style lang="scss" scoped>
.chromeDownload {
  box-sizing: border-box;
  padding: 10px 0;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  color: #8896b3;
  line-height: normal;
  flex-direction: column;
  .el-divider {
    margin: 0;
  }
  .chrome-text {
    box-sizing: border-box;
    padding-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    & > .left {
      margin-right: 10px;
    }
    & > .right {
      display: flex;
      align-items: center;
      & > .left {
        margin-right: 5px;
        img {
          width: 30px;
          height: 30px;
          object-position: center;
          object-fit: contain;
        }
      }
      & > .right {
        text-align: left;
        p {
        }
      }
    }
  }
  .chrome-download-link {
    margin-top: 5px;
    display: flex;
    align-items: center;
    & > * + * {
      margin-left: 5px !important;
      margin-right: 0 !important;
    }
    & > * {
      cursor: pointer;
      transition: 0.2s;
      &:hover {
        border-color: #1f75d5;
        background-color: #1f75d5;
        color: white;
      }
      &:active {
        transform: translate(1px, 1px);
        opacity: 0.618;
      }
    }
  }
}
</style>
相关推荐
code2cat几秒前
Vue项目实战之任务保存:编辑失败后,怎样保留输入再重试
前端·javascript·vue.js
1-1=026 分钟前
Vue TodoList
前端·javascript·vue.js
feixing_fx12 小时前
解构与展开:可读性和性能的取舍
开发语言·前端·javascript·前端框架
前端架构师-老李13 小时前
html教程:header、nav、main、footer 四个标签各管哪一块?
前端·html
烟雨空灵14 小时前
25 天做了个独立开发者作品橱窗,收录 340+ 件作品,代码全开源
前端·node.js
wangruofeng14 小时前
怎么让你的项目更好看?用 UI Lab 练设计原则,给界面去 AI 味
前端·aigc·ai编程
用户693717500138415 小时前
AI 越强,为什么我们反而越来越担心失业?
前端·后端·github
涛涛ing16 小时前
线上突发大面积白屏,排查一天后,我发现是 `JSON.parse` 背了锅
前端
狮子座的男孩16 小时前
javascript 基础 es6:1、let 声明,let 实践案例,const 声明,解构赋值
前端·javascript·经验分享·es6·const声明·解构赋值·let声明及案例
拖孩17 小时前
又又又用 AI 写了个小程序:我站起来猛蹬 AI,使劲薅羊毛
前端·后端·微信小程序