简单补充注册功能

This commit is contained in:
2024-04-16 19:10:38 +08:00
parent d175a5dedf
commit ae1a80869c

View File

@ -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