vue+element简单实现商城网站首页,模仿电商商城

1.安装启动vue项目可参考

3.项目结构图

4.src/page/top/index.vue

5.src/page/index/index.vue

<template>
  <div id="body" style="width: 100%;height: 100%;overflow: auto;">
    <top></top>
    <router-view></router-view>
    <foot></foot>
  </div>
</template>

<script>
  import top from "../top/index.vue";
  import foot from "../foot/index";

  export default {
      components: {
        top,
        foot
      },
      name: "index",
      data() {
        return {
        };
      },
      mounted() {
      },
      methods: {
      }
    };
</script>

<style>
  #body{
    background-size: 100% 100%;
    background-repeat: no-repeat;
  }
</style>

6.src/page/foot/index.vue

<template>
  <div style="font-size: 14px;">
    <div style="margin: 50px 200px 50px 200px;">
      <div style="display: flex;">
        <div style="flex: 1;display: flex;">
          <div style="">
            <div class="foot-title">帮助中心</div>
            <div class="foot-item">账户管理</div>
            <div class="foot-item">购物指南</div>
            <div class="foot-item">订单操作</div>
          </div>
          <div style="margin-left: 100px;">
            <div class="foot-title">服务支持</div>
            <div class="foot-item">账户管理</div>
            <div class="foot-item">购物指南</div>
            <div class="foot-item">订单操作</div>
          </div>
          <div style="margin-left: 100px;">
            <div class="foot-title">线下门店</div>
            <div class="foot-item">账户管理</div>
            <div class="foot-item">购物指南</div>
            <div class="foot-item">订单操作</div>
          </div>
          <div style="margin-left: 100px;">
            <div class="foot-title">支付方式</div>
            <div class="foot-item">账户管理</div>
            <div class="foot-item">购物指南</div>
            <div class="foot-item">订单操作</div>
          </div>
        </div>
        <div style="width: 250px;border-left: 1px solid #dfdfdf;text-align: center;">
          <div style="color: #19b4ea;font-weight: bold;font-size: 18px;line-height: 40px;">000-123456789</div>
          <div style="color: gray;">周一至周日8:00~18:00</div>
          <div style="color: gray;margin-bottom: 10px;">(节假日不休)</div>
          <el-button type="success" round icon="el-icon-headset">24小时客服在线</el-button>
        </div>
      </div>

    </div>
    <div style="background-color: #19b4ea;height: 40px;text-align: center;line-height: 40px;color: #FFFFFF;">
      申明:本网页仅供学习参考 @XXX XXX XXX
    </div>
  </div>

</template>

<script>
</script>

<style>
  .foot-title{
    height: 40px;
    line-height: 40px;
  }
  .foot-item{
    height: 25px;
    line-height: 25px;
    color: gray;
  }
  .foot-item:hover{
    cursor: pointer;
    color: #e37a2f;
  }
</style>
经验分享 程序员 微信小程序 职场和发展