简单补充注册功能
This commit is contained in:
parent
d175a5dedf
commit
ae1a80869c
@ -3,11 +3,32 @@
|
||||
div.card
|
||||
.left CREATE
|
||||
.right
|
||||
input(placeholder="account")
|
||||
input(placeholder="password")
|
||||
button Submit
|
||||
input(placeholder="account" v-model="name")
|
||||
input(placeholder="password" v-model="password")
|
||||
button(@click="login({name, password})") Submit
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data: () => ({
|
||||
name: "",
|
||||
password: "",
|
||||
}),
|
||||
methods: {
|
||||
login(data) {
|
||||
this.$axios.post("/api/user", data).then(res => {
|
||||
console.log(res.data)
|
||||
|
||||
// 修改页面 .card 为提示注册成功
|
||||
const card = document.querySelector('div.card')
|
||||
if (card) card.innerHTML = '注册成功'
|
||||
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="sass">
|
||||
.account-create
|
||||
padding-top: 6rem
|
||||
|
Loading…
Reference in New Issue
Block a user