You need to save value1
in the data block, then write a function to handle form submission:
(您需要将value1
保存在数据块中,然后编写一个函数来处理表单提交:)
data() {
return {
email: "",
password: "",
value1: false, // remember the user
};
},
methods: {
submitForm() {
// send form data to the server
}
}
To connect your button to a method, use @click="submitForm()
inside the HTML <button>
tag.
(要将按钮连接到方法, @click="submitForm()
在HTML <button>
标记内使用@click="submitForm()
。)
Note a better variable name might be rememberUser
.
(请注意,更好的变量名称可能是rememberUser
。)
Also I notice you're missing <template>
and <script>
tags. (我也注意到您缺少<template>
和<script>
标记。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…