帮我用vue3写一个电力系统登录页面
时间: 2023-04-03 11:04:07 浏览: 57
好的,我可以为您提供一个电力系统登录页面的示例代码,使用Vue3编写。以下是代码:
<template>
<div class="login-container">
<h1>电力系统登录</h1>
<form>
<div class="form-group">
<label for="username">用户名</label>
<input type="text" id="username" v-model="username" required>
</div>
<div class="form-group">
<label for="password">密码</label>
<input type="password" id="password" v-model="password" required>
</div>
<button type="submit" class="btn btn-primary" @click.prevent="login">登录</button>
</form>
</div>
</template>
<script>
import { reactive } from 'vue';
export default {
name: 'Login',
setup() {
const state = reactive({
username: '',
password: '',
});
const login = () => {
// TODO: 实现登录逻辑
};
return {
...state,
login,
};
},
};
</script>
<style scoped>
.login-container {
max-width: 400px;
margin: 0 auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
}
.form-group {
margin-bottom: 20px;
}
label {
display: block;
margin-bottom: 5px;
}
input[type="text"],
input[type="password"] {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 16px;
}
button[type="submit"] {
display: block;
width: 100%;
padding: 10px;
border: none;
border-radius: 5px;
background-color: #007bff;
color: #fff;
font-size: 16px;
cursor: pointer;
}
button[type="submit"]:hover {
background-color: #0069d9;
}
</style>
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)