Blame view

src/views/home/about.vue 2.15 KB
宋楠 committed
1 2 3 4 5 6 7 8
<!-- home -->
<template>
  <div class="app-container">
    <div class="warpper">
      <h1 class="demo-home__title"><img src="https://imgs.solui.cn/weapp/logo.png" /><span>VUE H5开发模板</span></h1>
      <h2 class="demo-home__desc">
        A vue h5 template with Vant UI
      </h2>
sunnie committed
9
      <div class="list">
宋楠 committed
10
        <div class="author"></div>
sunnie committed
11 12 13
        <div class="item">项目地址: <a href="https://github.com/sunniejs">https://github.com/sunniejs</a></div>
        <div class="item">项目作者: sunnie</div>
        <div class="item"></div>
宋楠 committed
14 15
        <div class="wechat"></div>
        <div>关注公众号:回复“加群”即可加 前端仙女群</div>
sunnie committed
16
      </div>
宋楠 committed
17 18 19 20 21 22
    </div>
  </div>
</template>

<script>
// 请求接口
宋楠 committed
23
import {getUserInfo} from '@/api/user.js'
宋楠 committed
24 25 26

export default {
  data() {
宋楠 committed
27
    return {}
宋楠 committed
28 29 30 31 32 33 34 35 36 37 38 39
  },

  computed: {},

  mounted() {
    this.initData()
  },

  methods: {
    // 请求数据案例
    initData() {
      // 请求接口数据,仅作为展示,需要配置src->config下环境文件
宋楠 committed
40
      const params = {user: 'sunnie'}
宋楠 committed
41
      getUserInfo(params)
宋楠 committed
42 43
        .then(() => {})
        .catch(() => {})
宋楠 committed
44 45 46 47 48 49
    }
  }
}
</script>
<style lang="scss" scoped>
.app-container {
宋楠 committed
50 51
  background: #fff;
  height: 100%;
宋楠 committed
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
  .warpper {
    padding: 12px;
    .demo-home__title {
      margin: 0 0 6px;
      font-size: 32px;
      .demo-home__title img,
      .demo-home__title span {
        display: inline-block;
        vertical-align: middle;
      }
      img {
        width: 32px;
      }
      span {
        margin-left: 16px;
        font-weight: 500;
      }
    }
    .demo-home__desc {
      margin: 0 0 20px;
      color: rgba(69, 90, 100, 0.6);
      font-size: 14px;
    }
sunnie committed
75 76 77
    .list {
      display: flex;
      flex-direction: column;
宋楠 committed
78
      align-items: center;
sunnie committed
79 80 81 82 83 84 85 86 87 88 89 90 91
      color: #666;
      font-size: 14px;
      .item {
        font-size: 14px;
        line-height: 24px;
      }
    }

    .author {
      width: 200px;
      height: 200px;
      background: url($cdn+'/weapp/me.png') center / contain no-repeat;
    }
宋楠 committed
92 93 94 95 96
    .wechat {
      width: 200px;
      height: 200px;
      background: url($cdn+'/wx/640.gif') center / contain no-repeat;
    }
宋楠 committed
97 98 99
  }
}
</style>