第一次提交项目
This commit is contained in:
11
src/views/home.vue
Normal file
11
src/views/home.vue
Normal file
@@ -0,0 +1,11 @@
|
||||
<template>
|
||||
<div>
|
||||
首页
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
53
src/views/login.vue
Normal file
53
src/views/login.vue
Normal file
@@ -0,0 +1,53 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<van-form @submit="onSubmit">
|
||||
<van-cell-group inset>
|
||||
<van-field
|
||||
v-model="account.id"
|
||||
name="id"
|
||||
label="用户名"
|
||||
placeholder="用户名"
|
||||
:rules="[{ required: true, message: '请填写用户名' }]"
|
||||
/>
|
||||
<van-field
|
||||
v-model="account.password"
|
||||
type="password"
|
||||
name="password"
|
||||
label="密码"
|
||||
placeholder="密码"
|
||||
:rules="[{ required: true, message: '请填写密码' }]"
|
||||
/>
|
||||
</van-cell-group>
|
||||
<div style="margin: 16px;">
|
||||
<van-button round block type="primary" native-type="submit">
|
||||
提交
|
||||
</van-button>
|
||||
</div>
|
||||
</van-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive} from 'vue';
|
||||
import { UserType } from '../types/user';
|
||||
import { userLogin } from '../api/user';
|
||||
|
||||
const account = reactive({
|
||||
id: "blahblah",
|
||||
password:"pwd123"
|
||||
})
|
||||
const onSubmit = (account:UserType) => {
|
||||
console.log('submit', account);
|
||||
userLogin(account).then(res => {
|
||||
console.log("登陆成功",res);
|
||||
|
||||
})
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.box{
|
||||
padding-top: 40px;
|
||||
}
|
||||
</style>
|
13
src/views/main.vue
Normal file
13
src/views/main.vue
Normal file
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
<RouterView />
|
||||
|
||||
<Footer></Footer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Footer from '../components/Footer.vue';
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
13
src/views/mine.vue
Normal file
13
src/views/mine.vue
Normal file
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
个人主页
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
Reference in New Issue
Block a user