vue后台管理系统(一)

node.js肯定是个前提,之前已经安装了,接下来直接进入正题
1、先安装vue-cli,这里是全局安装,安装过了之后再建vue项目就可以不用再安装了

npm install vue-cli -g

2、创建项目

vue create bgmanage-vue 

一路回车,但是注意有一项选项一定要选路由,不然后面要手写很麻烦。记录一下我的配置选项以免以后忘记
第一个是严格模式打扰了
在这里插入图片描述
之后就一路enter接下来最后给以上的操作命名,这样以后就不用重复配置了
在这里插入图片描述
3、安装并引用element-ui

npm install element-ui --save

在src/main.js中写入以下

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)

4、创建登录页面
在src/view下创建页面,我们的登录页面叫做TheLogin.vue

<template>
  <div class="login">
    <div class="middle-wrapper">
      <div class="title-wrapper">
        <div class="title">什么鬼后台管理系统</div>
      </div>
      <div class="login-form">
        <el-form>
          <el-form-item prop="username">
            <el-input placeholder="请输入账号">  
              <i slot="prefix" class="el-input__icon el-icon-adm-user" style="font-size: 18px;"></i>
            </el-input>
          </el-form-item>
          <el-form-item prop="password">
            <el-input placeholder="请输入密码">  
              <i slot="prefix" class="el-input__icon el-icon-adm-password" style="font-size: 18px;"></i>
              <i slot="suffix" class="el-input__icon el-icon-view" style="cursor: pointer;"
                 ></i>
            </el-input>
          </el-form-item>
          <el-form-item style="margin-bottom: 0;">
            <el-col :span="10" :offset="7">
              <el-form-item>
                <el-button
                  type="primary"
                  class="login-btn"
                  style="width: 100%;"
                 >
            
                  登陆系统
                </el-button>
              </el-form-item>
            </el-col>
          </el-form-item>
        </el-form>
      </div>
    </div>
  </div>
</template>
<script>
 

  export default {
  }
</script>
<style lang="scss" scoped>
  .login {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: url('../assets/bgpic.jpg') no-repeat;
    background-size: 100% 100%;

    .middle-wrapper {
      position: fixed;
      width: 100%;
      margin: 0 auto;
      top: 50%;
      transform: translateY(-60%);

      .title-wrapper {
        margin-top: 50px;
        margin-bottom: 30px;
        text-align: center;
        font-size: 30px;
        font-weight: bold;
        color: #ffffff;
      }
      .login-form {
        position: relative;
        margin: 0 auto;
        width: 520px;
        padding: 30px 50px;
        box-sizing: border-box;
        border-radius: 5px;
        background-color: rgba(255,255,255,.5);

        .el-row {
          margin-bottom: 20px;

          &:last-child {
            margin-bottom: 0;
          }

          .login-btn {
            width: 100%;
          }
        }

        .check-code-wrapper {
          display: flex;
          justify-content: space-between;
          height: 40px;

          .yanzhengma-wrapper {
            flex: 0 1 auto;
          }

          .validate-code-wrapper {
            flex: 0 0 160px;
          }
        }
      }
    }
  }
</style>

5、创建登录页面的路由
在src/router.js里引入路由

import Login from './views/TheLogin.vue'

   {
      path: '/login',
      component: Login
    }

6、最终呈现
在这里插入图片描述

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值