
<template>
  <el-form :model="form"
           :rules="rules"
           ref="form"
           label-position="left"
           label-width="0px"
           class="login">
    <h3 class="login__title">系统登录</h3>
    <el-form-item prop="account">
      <el-input type="text"
                v-model="form.account"
                auto-complete="off"
                placeholder="账号"></el-input>
    </el-form-item>
    <el-form-item prop="checkPass">
      <el-input type="password"
                v-model="form.checkPass"
                auto-complete="off"
                placeholder="密码"></el-input>
    </el-form-item>
    <el-checkbox v-model="checked"
                 checked
                 class="login__remember">记住密码</el-checkbox>
    <el-form-item style="width:100%;">
      <el-button type="primary"
                 style="width:100%;"
                 @click.native.prevent="handleSubmit">登录</el-button>
    </el-form-item>
  </el-form>
</template>

<script lang="ts">
import { Vue, Component } from "vue-property-decorator";

@Component
export default class Login extends Vue {
  form = {
    account: "admin",
    checkPass: "123456"
  };

  rules = {
    account: [{ required: true, message: "请输入账号", trigger: "blur" }],
    checkPass: [{ required: true, message: "请输入密码", trigger: "blur" }]
  };

  checked = true;

  handleSubmit() {
    this.$router.replace({ name: "Home" });
  }
}
</script>

<style lang="scss" scoped>
@import "@/assets/styles/login.scss";
</style>