iview selection box inside: value and: key refers to what?

<Select v-model="model1" style="width:200px">
        <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
</Select>

  

value specifies the value of the value of the selected item, use the v-model two-way data binding. String or Number accept only when the radio, only accept while making multiple selections Array (v-model binding is the current default display option which is determined by value) 
Key Vue is to give a hint, so that it can track each node identity, in order to reuse existing elements and reorder, you need to provide a unique key for each property

 

item.label: This is for the user to see when you click on the drop-down menu, will come out option, users see this option is 
value: this is, after you click on a label (option), the corresponding value to the v-model binding values MODEL1 
Key: it is equivalent to the identity token, the only prevent errors, although there is no line, but the official website is still recommended for good plus

 

Guess you like

Origin www.cnblogs.com/LFxanla/p/11105668.html