use "v-for" and "v-if" on a same <template> tag render strange

This issue has been created since 2022-08-17.

Version

2.4.4

Reproduction link

codepen.io

Steps to reproduce

<template>
  <div>
    <template v-for="item in [1, 2, 3, 8]" v-if="flag === 1">{{item}}</template>
    <template v-for="item in [5, 6, 7]" v-else>{{item}}</template>
  </div>
</template>

data: {
  flag: 2
}

What is expected?

render "5 6 7"

What is actually happening?

render "5 6 7 5 6 7 5 6 7 5 6 7"

sodatea wrote this answer on 2022-08-17

https://v2.vuejs.org/v2/guide/list.html#v-for-with-v-if
It is strongly discouraged to use v-if and v-for on the same node.
So I don't think this behavior is worth fixing.

More Details About Repo
Owner Name vuejs
Repo Name vue
Full Name vuejs/vue
Language TypeScript
Created Date 2013-07-29
Updated Date 2022-09-27
Star Count 199644
Watcher Count 6098
Fork Count 32848
Issue Count 587

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
[bug] `sendTransaction` is not working with `recklesslySetUnpreparedRequest` 3 2022-07-27 2022-09-06
🐛 [firebase_auth] Crash on Motorola's phones 4 2022-07-06 2022-09-09
Yarn-pre-job不支持配置checkpoint、开启checkpoint间隔、checkpoint超时作废时间、从checkpoint恢复 1 2022-03-10 2022-07-23
[Issue]: Field list values with JMeter variables may be treated as sequence and field lists depending on the number of values 5 2022-05-06 2022-07-20
Просьба именовать файлы правил соответственно классу точности 1 2021-03-12 2022-09-18
Trying to get in touch regarding a security issue 0 2021-09-21 2022-07-29
Incompatible small screen display in the donation page 1 2021-01-20 2022-09-19
differences in the nuScenes volexnet config files 1 2022-03-15 2022-08-01
v1.2 agent 修改了HTTP请求的Content-Type,导致应用无法正常使用 2 2022-05-07 2022-09-12
Cannot use import statement outside a module 2 2021-03-12 2022-09-25
Is encoder gifski only work just for windows x64 but not x86? 5 2019-03-09 2022-09-26
When input wordlist has a line with length>65535, an exception raises 0 2022-05-24 2022-09-26
Contact of recipient TradeParty is ignored in XRechnung 3 2021-01-14 2022-09-19
[UI] Build Failure: PatternForm.js 1 2021-12-03 2022-09-03
Add a --skip-existing option when creating a virtualenv 3 2015-07-18 2022-09-17
Add Youtube Embed Link For Intune Integration Overview to Docs Page 4 2022-05-25 2022-09-14
Helm chart for zipkin 4 2021-09-07 2022-09-22
[BUG] Shadowsocks-Plugin节点的Path参数被自动加入redirect参数从而导致显示不一致现象 1 2021-07-01 2022-09-12
[BUG]使用新版数据库xcat Backup simple提示权限不足并无法正常备份 2 2021-06-21 2022-09-21
php xcat Tool initdownload显示方法不存在. 1 2021-06-21 2022-09-20
[BUG]最新dev设置DailyJob出现错误无法重置 1 2021-06-13 2022-09-23
“触碰到审计规则,连接已被阻断”在哪里进行修改 1 2021-06-19 2022-09-02
`RemotePkgType` is not necessarily something that we can pass to `available.packages()` 2 2021-05-19 2022-08-30
Security Flaw: Cannot obfuscate local wallet 0 2021-03-02 2022-08-04
Document Spatialite / Postgis requirements for map usage 13 2021-08-26 2021-12-24
Mute not working in multichannel 2 2021-12-13 2022-07-16
UAP13:AutoUpdate child element is missing from the Package level Extension element. 1 2022-07-11 2022-09-24
Text isn't being drawn on Ubuntu 1 2022-02-20 2022-08-02
@textlint/browser 12 2017-09-15 2022-01-20
undefined method `exclude_loggers' for nil:NilClass during Rails boot on production 13 2022-07-26 2022-09-14
Python: MegaApi.startStreaming() only gives me a fraction of the data 7 2022-03-05 2022-09-15
Add log_event_data to DataTransport 0 2022-01-31 2022-07-29
Kafka sasl.jaas.config cannot be passed as a secret 1 2021-09-06 2022-09-06
OnChange of Options Picker to Set Value of Relationship Picker causes app to crash 2 2022-08-05 2022-08-15
Tests with `toBeVisible()` matcher failed on components use default `_` responsive attribute 1 2022-05-23 2022-09-19
splitting chunk 2 2021-09-06 2021-11-20
Who is using open ports? 1 2021-09-10 2022-08-17
find_package(Corrosion REQUIRED) error. 0 2021-09-20 2022-07-27
old problem "Unhandled Exception: MissingPluginException" 3 2021-06-09 2022-09-24
Adaptive Cards: Action set with role="menubar" must have 1 or more descendants with role="menuitem". 1 2021-06-16 2022-09-14
fp instruction exception when rm field is set dyn 0 2020-09-14 2022-09-13
Histogram tooltip issue 1 2022-06-03 2022-09-25
Data.Pool makes certain transactions unusable. 29 2012-11-07 2022-07-21
Core: Deprecate ${} Gatling EL syntax in favor of #{} 1 2021-11-05 2022-06-29
Fix for error 3 2012-01-16 2021-12-30
Update commit queue token permission 12 2021-11-07 2022-09-26
The Avatars, Scenes and 3D Models previews are not rendered 1 2021-11-29 2022-07-16
podman cp can overwrite existing files/directories 9 2022-05-30 2022-09-19
Helper: replace like ltrim and rtrim 2 2021-05-07 2022-09-16
Will the old blocks keep moving into the ancient dir during the Geth running? 1 2022-06-13 2022-09-10