天天看點

ant design vue簡單登入界面

ant design vue簡單登入界面
<template>
  <div class="login-container">
    <h2 class="login-title">我的登陸頁面</h2>
    <a-form ref="form" :model="form" class="login-form">
      <h2 class="title">使用者登入 LOGIN</h2>
      <a-form-item>
        <a-input v-model="form.username">
          <a-icon slot="prefix" type="user" />
        </a-input>
      </a-form-item>
      <a-form-item>
        <a-input-password v-model="form.password">
          <a-icon slot="prefix" type="unlock" />
        </a-input-password>
      </a-form-item>
      <a-form-item>
        <a-button class="submit" type="primary" @click="onSubmit">登入</a-button>
      </a-form-item>
    </a-form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      form: {
        username: "admin",
        password: "admin",
      },
    };
  },
  methods: {
    onSubmit() {
      console.log("登陸成功!");
    },
  },
};
</script>
<style scoped>
.login-form {
  width: 565px;
  height: 372px;
  margin: 0 auto;
  background: url("../../assets/houTaiKuang.png");
  padding: 40px 110px;
}

/* 背景 */
.login-container {
  position: absolute;
  width: 100%;
  height: 100%;
  background: url("../../assets/mcdku.jpg") no-repeat;
  background-size: 100% 100%;
}

/* Log */
.login-title {
  color: #fff;
  text-align: center;
  margin: 100px 0 60px 0;
  font-size: 36px;
  font-family: Microsoft Yahei;
}
/* 登陸按鈕 */
.submit {
  width: 100%;
  height: 45px;
  font-size: 16px;
}
/* 使用者登陸标題 */
.title {
  margin-bottom: 50px;
  color: #fff;
  font-weight: 700;
  font-size: 24px;
  font-family: Microsoft Yahei;
}
/* 輸入框 */
.inputBox {
  height: 45px;
}
/* 輸入框内左邊距50px */
.ant-input-affix-wrapper .ant-input:not(:first-child) {
  padding-left: 50px;
}
</style>
           
ant design vue簡單登入界面
ant design vue簡單登入界面