When the v-if or v-show login pop-up box in vue exits and logs in again, the value in the input box is not cleared.

there is only one page, and there is no route or anything. The login box is a pop-up box. If you log in, v-show or v-if pop-up box. At the beginning, the v-show found that the value in the input box has not been eliminated (it does not allow the browser to record the login information), and then change to VIFMAG VFI if the pop-up box is cleared after closing the pop-up box, but the login is successful. After logging out, click on the login pop-up box, and the input value in the pop-up box is still there. At this point, I see that there should be a key value in v-if, then I use random values to add key = "random number" to the input box of the user name and password. The random number is generated when the pop-up box appears and switches to the login page, but at this time the value in the input box still exists. Input uses vMube model, what is the problem? How to solve it? Or should you write code after a successful login and manually set the user name and password to be blank? Or leave it empty every time the bounce box appears. Will it be possible to use the saved username and password function of the browser?

Mar.06,2021

because is there any value in your ViewModel


this is really a strange question. I checked that in the exercise I did before, there is no problem with logging in the normal vuex management pop-up box and logging out of the clear value. If you let the browser remember the password, it will be filled in automatically, and if you don't let it remember, there will be no automatic filling. But not in this project. The problem has been solved repeatedly, but it is not clear why.
here I would like to describe my project management and problem solving again. Please help me with the principle.
first of all, as soon as you enter the page, you will go to the request API to determine whether there is login information. If there is a request for login information, save it in vuex and use it elsewhere, and display the login name on the page. If you don't have it, you won't deal with it (this piece is actually unreasonable, but we did it out of some considerations);
Login is to click the button and pop up a pop-up box to log in, send login information to the background, and then go to the background to request the returned login information after success. Because something needs to be encrypted in the background, you get the password, ID card and other information from the background again, but these have nothing to do with the input value in the login box. The value in input is not maintained in vuex. (and during my troubleshooting process, the values in input are maintained in vuex, and emptying still does not achieve the desired results when logging out.) The login information maintained in vuex is cleared when logging out.
there is one more point: when my login box pops up, it is still a v-if v-else combination, because you first want to display a page of digital ID login, then press ctrl+q and then switch to the form login box;
solution:
check repeatedly, you must achieve these two points in order to achieve the desired results:
1, the browser records the password after using the form package form before it can be filled in automatically, otherwise it will never be filled automatically. (all button in form is changed to a, otherwise the page will be automatically refreshed.)
2 and v-if must be written in the location of the calling child component in the parent component
< login-wrap VMI if = "loginBoxFlag" > < / login-wrap > ,
but not on the outermost div of the child component, otherwise, even if the browser is not allowed to remember the password, input exists after each logout and the login box pops up. And input does not have a yellow background (that is, the background color when the browser automatically fills it)

I don't know what the problem is. If you have any understanding, please analyze it for me, 3Q.

Menu