VueJS:提交表单后更改占位符
VueJS: Change placeholder after form submission
我想在提交表单后清除表单的占位符。但是我下面的代码似乎不起作用。它不会清除输入文本字段。
data() {
return {
placeholder: "https://www.youtube.com/watch?v=VooQbNHP44M",
};
},
<form @submit.prevent="submitVideo">
<div class="flex">
<input
type="text"
:placeholder="placeholder"
v-model="yturl"
/>
async submitVideo() {
this.placeholder = "";
}
任何帮助将不胜感激。
async submitVideo() {
this.placeholder = ""; // clears placeholder value
this.yturl = ""; // clears input value
}
我想在提交表单后清除表单的占位符。但是我下面的代码似乎不起作用。它不会清除输入文本字段。
data() {
return {
placeholder: "https://www.youtube.com/watch?v=VooQbNHP44M",
};
},
<form @submit.prevent="submitVideo">
<div class="flex">
<input
type="text"
:placeholder="placeholder"
v-model="yturl"
/>
async submitVideo() {
this.placeholder = "";
}
任何帮助将不胜感激。
async submitVideo() {
this.placeholder = ""; // clears placeholder value
this.yturl = ""; // clears input value
}