You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.4 KiB

3 years ago
<template>
<div class="page-container">
<div class="page-outer">
3 years ago
<el-form>
<el-form-item label="账号">
<el-input v-model:value="form.username" placeholder="账号" />
</el-form-item>
<el-form-item label="密码">
<el-input type="password" v-model:value="form.password" placeholder="密码" />
</el-form-item>
<el-form-item>
<el-button type="primary" style="width: 100%" @click="submit"
> </el-button
3 years ago
>
3 years ago
</el-form-item>
</el-form>
3 years ago
</div>
</div>
</template>
<script>
import { useStore } from "vuex";
import { defineComponent, reactive, getCurrentInstance } from "vue";
export default defineComponent({
name: 'v-login',
setup() {
const { proxy } = getCurrentInstance();
const store = useStore();
const form = reactive({
username: "admin",
password: "111111",
});
return {
form,
proxy,
store
};
},
methods: {
submit() {
3 years ago
// this.proxy.$post("/user/login", this.form).then((res) => {
// const data = res.data;
// this.store.commit("setToken", data.token);
// });
this.$router.push('/');
3 years ago
},
},
});
</script>
<style lang="less" scoped>
.page-container {
position: relative;
width: 100%;
height: 100%;
.page-outer {
width: 400px;
3 years ago
transform: translate(170%, 280%);
3 years ago
}
}
</style>