--- title: Never Use v-if and v-for on the Same Element impact: HIGH impactDescription: Causes confusing precedence issues and Vue 2 to 3 migration bugs type: capability tags: [vue3, v-if, v-for, conditional-rendering, list-rendering, eslint] --- # Never Use v-if and v-for on the Same Element **Impact: HIGH** - Using `v-if` and `v-for` on the same element creates ambiguous precedence that differs between Vue 2 and Vue 3. In Vue 2, `v-for` had higher precedence; in Vue 3, `v-if` has higher precedence. This breaking change causes subtle bugs during migration and makes code intent unclear. The ESLint rule `vue/no-use-v-if-with-v-for` enforces this best practice. ## Task Checklist - [ ] Never place v-if and v-for on the same element - [ ] For filtering list items: use a computed property that filters the array - [ ] For hiding entire list: wrap with `