Skip to content
🌏 Translated with the assistance of DeepSeek and ChatGPT

Controlled Mode and Uncontrolled Mode

For general components that support two-way binding, passing modelValue puts them into controlled mode. If not passed or set to undefined, they are in uncontrolled mode, where the defaultValue property can be passed as the default value.

Therefore, please do not use undefined as the empty value in controlled mode. We recommend using empty values corresponding to the data structure (such as '' for strings, [] for arrays) or null as the empty value in controlled mode.

The same applies to component properties in the following forms:

  1. xxx that supports v-model
  2. Having defaultXxx as the default value