Home > front end >  Axios get request to the input input values to the background
Axios get request to the input input values to the background

Time:09-18

My train of thought is the parameter to the URL but not get inside, the background is the servlet

CodePudding user response:

Simple way to 'http://address? Hi='+ this input

CodePudding user response:

Axios request is right, but haven't seen you such a vue grammar, good advice about the use of vue
To obtain input values can be placed in mounted

CodePudding user response:

This. Input to find the input data of the Vue instance, found that can't find, you should be here directly with the input rather than this. The input, or directly with v - the value of the input model binding & lt; Input the id="input" type="text" v - model="info. The name"/& gt; , only the user input will be directly stored in the data inside Info. Name, then params become params: {hi: this. Info. Name}

CodePudding user response:

reference flares UP reply: 3/f
this. Input to find the input data of the Vue instance, found that can't find, you should be here directly with the input rather than this. The input, or directly with v - the value of the input model binding & lt; Input the id="input" type="text" v - model="info. The name"/& gt; , only the user input will be directly stored in the data inside Info. Name, then params become params: {hi: this. Info. Name}

Can I write a complete

CodePudding user response:

Suggest you go to see the vue instruction v - model binding input box, and then the data have a binding, request directly with data values to use of the
Axios request also suggest that you also have a look at the way
Can get request if you want to on the path, ` xxx.com? inputValue=https://bbs.csdn.net/topics/${enclosing inputValue} ` premise is By this time the vue instance inside the corresponding data
Data () {
Return {
InputValue: '//this place is, the value of the two-way data binding, after enter this place can get the value of the input box just request directly to
}
}

CodePudding user response:

Good it's go to the, thank you
  • Related