I would like to be able to dynamically change the types,lables of an input field between text and email,number. how that possible ,i am new in vue js:
<input type="email">
I would like to be able to dynamically change the types,lables of an input field between text and email,number. how that possible ,i am new in vue js:
<input type="email">
First you need to declare this in your data:
data () {
return {
inputType: "text",
lableName: "Default",
}
}
Now you use these variables in your html:
<label>{{ lableName }}</label>
<input :type="inputType">
The last part is to define the logic when these values change. However, I don't know when or why you want to change this. If you elaborate I can edit.
Hope this helps already :)