Vue: Select dropdown is clearing other inputs when changing value

前端 未结 1 1991
自闭症患者
自闭症患者 2021-01-26 06:05

I have a form with input values. When I have a select with a v-model on it and go to change the drop down value, the input from the previous fields clear. I made a simple code

1条回答
  •  情歌与酒
    2021-01-26 06:52

    I had the same problem, and for me the problem was that I saved the value of the text input in a prop, but it should be saved in the data method.

    So the element looks like:

    
    

    End then in the script part:

    data() {
        return {
            value: ''
        }
    }
    

    0 讨论(0)
提交回复
热议问题