Views: 2693
Last Modified: 27.04.2022
  • attribute use :key

    It's no longer required to indicate a key for instructions v-if/v-else/v-else-if – Vue does it automatically.

    You won't be able to indicate keys manually, but each key must have a unique name.

    When using the tag <template> with iterator v-for, the key must be located on this tag instead of its children, as before.

    Before:

    <template v-for="item in list">
      <div :key="'heading-' + item.id">...</div>
      <span :key="'content-' + item.id">...</span>
    </template>
    

    Now:

    <template v-for="item in list" :key="item.id">
    	<div>...</div>
    	<span>...</span>
    </template>
    

    You can read more about such this update in the migration guide.

  • using instruction v-if jointly with v-for

    Now v-if has the priority when using v-if jointly with v-for at a single element.

  • using instruction v-model

    If you have used the instruction v-model, you must read the article about the key changes in the migration guide.





Courses developed by Bitrix24