I am trying to pass a variable url in form action but couldn’t do so with the following code:
<form action="${url}/auth/login_student" method="POST">
....</form>
And in script tag
export default {
data() {
return{
url: "http:5000/localhost"
}
}
}
>Solution :
You have to use v-bind to set action to a JavaScript expression. You can then use a template string.
<form :action="`${url}/auth/login_student`" method="POST">
^ ^ ^