Two input input boxes, the a box is the max,b box, the value entered for the min,b box cannot be greater than the a box, and the value entered in the a box cannot be less than the b box, is there any good way?

< input type= "text" v muri model = "input_max" > < / input > / / max
< input type= "text" v muri model = "input_min" > < / input > / / min

Mar.10,2021

change event, you can get both input_max and input_min. No matter which input input value changes, you can compare it. When you find illegal input, you can take an action, prompt or empty it. You can


first guess from the provided code:

use bidirectional binding of frame Vue, data (also wonder why lowercase input is a double tag, the editor will not report an error)

input input box exists change event, which is @ change event in Vue. You can compare the size of two values (input_max,input_min) by listening to change event.

Menu