Solve the problem that el-form will trigger form validation once it enters the page

The following example is to solve the el-select multiple drop-down multi-select controlinsert image description here

The expected effect is: when the page is opened, the outgoing location is the same as other attributes, and the non-empty check of the form will not be automatically triggered, but will be triggered when the current attribute is operated.
Solution: Set the initial value to an empty array

data() {
    return {
      form: {
        goOutArriveCityId: []
      },
    }

If it is not multi-choice, it is an input box or other, just initialize the corresponding value. The idea is probably like this~

Guess you like

Origin blog.csdn.net/weixin_41262185/article/details/130647242