The component rerenders without updating anything

This issue has been created since 2022-10-26.

Version

2.7.13

Reproduction link

codesandbox.io

Steps to reproduce

  1. Open the CodeSandbox link and view the console
  2. It's logical to print "app 更新"
  3. But it also prints "comp1 更新"
  4. The comp1 component didn't change anything, so why did it render again?

What is expected?

Do not print "comp1 更新"

What is actually happening?

it prints "comp1 更新"

1593292349 wrote this answer on 2022-10-27
1593292349 wrote this answer on 2022-10-27

If I delete the slot for the Comp1 component, the Comp1 component will not be rerendered
image

1593292349 wrote this answer on 2022-10-27

v3.2.41 also has this problem

yyx990803 wrote this answer on 2022-11-09

This is a known behavior/limitation of Vue 2 because you are passing slot content to the child.

This is not present in Vue 3: playground

1593292349 wrote this answer on 2022-11-09

@yyx990803 In vue2, I packaged a lot of components and made a lot of use of slots. There was a performance bottleneck in the fact that slots were constantly being re-rendered when they didn't change. How can I improve?

More Details About Repo
Owner Name vuejs
Repo Name vue
Full Name vuejs/vue
Language TypeScript
Created Date 2013-07-29
Updated Date 2022-12-10
Star Count 201155
Watcher Count 6070
Fork Count 33134
Issue Count 595

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
웹폰트 사용 시 모바일환경 baseline 문제 3 2021-03-09 2022-10-04
Spoqa Han Sans -> Spoqa Han Sans Neo migration 이슈 5 2021-01-14 2022-10-04
윈도우 프로그램에서 폰트사용시 뭉개짐 현상이 있는데요 5 2021-03-09 2022-10-04
Numeric values are ordered as Text (Apex Classes and Triggers Tabs) 0 2021-04-22 2022-11-05
deletion of an item after giving feedback 1 2022-08-06 2022-12-03
need help building for arm 32 1 2021-09-21 2022-11-14
Bug: Unable to install chromium-web-store extension in Windows x64 (latest version) 0 2021-09-16 2022-11-14
Capture TCP traffic through iptables & NoPE 1 2022-03-07 2022-11-16
migrate from travis to github actions 0 2021-06-28 2022-12-05
Multiselect for ALT-A Command Line Arguments shortcut 0 2022-01-09 2022-11-12
About IMU error inside Tracking 0 2022-08-17 2022-12-02
error unity with example provided 3 2021-07-28 2022-12-08
`dbWriteTable` fails to find tables in non-default schemas 12 2017-06-13 2022-11-13
"Running from source" wiki page is misleading with final dots after "pip install" 2 2022-03-10 2022-10-04
Replacing workspaces with windows native Virtual Desktops - POLL 11 2021-06-28 2022-12-03
HACS 已禁用 - HACS 无法加载 2 2022-03-07 2022-11-18
Is it still possible to submit assignments to coursera? 5 2022-08-10 2022-12-03
crashes when attribute values are not identical 1 2021-08-27 2022-10-25
View reverse engineer is not creating properties for calculated columns 3 2022-11-04 2022-12-02
Auto-closing void elements in C# blocks does not work as epected 2 2022-05-18 2022-11-15
Reading labels is not fully working 35 2021-07-06 2022-11-10
add issue templates 0 2021-06-28 2021-11-13
Extention Causes high CPU load 1 2021-05-16 2022-11-28
Standups: Active meetings menu doesn't work with standups 3 2022-05-25 2022-10-14
ARM (Raspberry Pi4) build fails: link error undefined reference to `__atomic_load_8' 9 2022-07-14 2022-08-12
Blank White Screen 1 2021-02-10 2022-01-05
dnf builddep like command 3 2017-03-03 2022-12-03
inspect dependencies & replace the deprecated ones 9 2020-07-06 2022-11-25
databend-meta: implement raft snapshot with on-disk file 0 2022-08-15 2022-10-04
Upexpected transaction behavior in race condition 3 2022-05-15 2022-11-20
New Capstone Perk: Orpheus Warp 0 2019-09-23 2022-12-05
Battery support for android-x86 9 2022-01-22 2022-11-27
关于数组的forEach方法中达到continue和break效果 1 2021-05-25 2022-11-25
[Pods 2.8 Bug] DateTime Timezone support 2 2021-06-08 2022-09-06
Can't debug an AvaloniaUI application on Visual Studio for Mac 6 2022-05-09 2022-11-06
[Bug]: GTK Stylesheets with dot in the name are not possible to package 0 2022-04-30 2022-11-05
Copter: 4.3 land complete flag fragility 0 2022-08-30 2022-10-25
Email notification sent when new dataset version is published confuses users about the state of their dataset 1 2022-01-24 2022-11-02
some links seems incorrects 9 2021-07-28 2022-09-29
git clone issue with packages/core/src/modules/dids/methods/peer/__tests__/DidPeer.test.ts 3 2022-08-17 2022-11-12
Set the default Ops limit to a more reasonable number 0 2021-04-06 2022-11-11
Fix documentation and format code clash 0 2022-08-16 2022-09-04
Challenge (Use the .env File): Clarify accessing process.env inside route hander 3 2022-02-24 2022-11-05
E1019 Throwing False Error When GetAtt DBClusterResourceId 4 2022-10-05 2022-11-14
Add thermal boundary layer calculations 1 2021-10-08 2022-11-08
Add ability to template locations 0 2020-09-29 2022-09-14
How do I access my Ethereum stored on a parity signer ios app in 2021? 4 2021-03-04 2022-11-13
log-format of json file for Fastly logs 2 2022-09-06 2022-12-03
Asset list needed for Aurora chain 0 2022-08-05 2022-08-01
Vue.extend name always is `VueComponent` in webpack, CDN is correct 2 2022-02-25 2022-12-08