码农齐齐齐
2022-09-07 c7a060b8465dfbb35bf307aa975ac74e2c665ec1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<template>
  <div id="background">
    <el-form
      :model="form"
      status-icon
      :rules="rules"
      ref="form"
      class="login-container"
    >
      <h3 class="login_title">用户登录 / USER LOGIN</h3>
      <el-form-item prop="username" class="username">
        <el-input
          type="input"
          v-model="form.username"
          auto-complete="off"
          placeholder="请输入用户名称"
        ></el-input>
      </el-form-item>
      <el-form-item prop="password" class="password">
        <el-input
          type="password"
          v-model="form.password"
          auto-complete="off"
          placeholder="请输入登录密码"
          prefix-icon="el-icon-s-custom"
        ></el-input>
      </el-form-item>
      <el-form-item class="submit_container">
        <el-button type="primary" class="login_submit">登录</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
 
<script>
export default {
  name: "login",
  data() {
    return {
      form: {},
      rules: {
        username: [
          { required: true, message: "请填写用户名称", trigger: "blur" },
          {
            min: 3,
            message: "用户名长度不能小于三位",
            trigger: "blur",
          },
        ],
        password: [{ required: true, message: "请填写登录密码", trigger: "blur" }],
      },
    };
  },
  methods: {},
};
</script>
<style lang="less" scoped>
#background {
  width: 100vw;
  height: 100vh;
  background-color: #015cf2;
  position: relative;
  display: flex;
  align-items: center;
}
.login-container {
  border-radius: 15px;
  position: absolute;
  right: 5%;
  width: 500px;
  background-color: white;
  box-shadow: 0 0 25px #cac6c6;
  .login_title {
    text-align: center;
    color: #ccc;
    font-size: 25px;
    font-weight: 400;
    height: 150px;
    line-height: 150px;
  }
  .submit_container {
    display: flex;
    justify-content: center;
    .login_submit {
      width: 400px;
      font-size: 25px;
      line-height: 40px;
      margin-bottom: 120px;
    }
  }
  .el-form-item {
    display: flex;
    justify-content: center;
    .el-input /deep/ .el-input__inner {
      height: 60px;
      width: 400px;
      &::-webkit-input-placeholder {
        font-size: 20px;
      }
    }
  }
}
</style>