Changing an item of an array directly by its index triggers a view responsiveness

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

Version

2.7.8

Reproduction link

jsfiddle.net

Steps to reproduce

<template>
   <div id="app">
        {{a[0]}} {{b[0].b}}
  </div>
</template>

data: {
   a:["hello"],
   b:[{"b":"world"}]
},
mounted() {
  this.a[0] = "world"
  this.b[0].b ="hello"

}

What is expected?

hello hello

What is actually happening?

world hello

LinusBorg wrote this answer on 2022-08-25

aassigning to this.b[0].b triggers a re-render of the component template. In that re-render, the latest data will be used for all content, so this behavior is totally normal.

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
Python Testing - Help Wanted 1 2022-07-05 2022-08-25
[Feature Request] Image viewer UX imorovements when viewing extra long images 2 2022-06-11 2022-09-15
Connection failure depending on the current working directory 9 2021-10-20 2022-08-30
File Autogrowth detection with time filtering capability 0 2020-10-11 2022-09-26
Add slot for FileDropzone to be able to change the wording/language 3 2021-05-31 2022-08-28
process exceptions are returned with http code 200 3 2020-12-15 2022-07-28
Integrating ldbm-image-background-remover into Android Project 6 2019-12-06 2022-08-23
Using sra-tools in my own Docker image 1 2021-05-29 2022-09-06
compileing glibc met the error: "make[3]: *** No rule to make target 'elf/soinit.c', needed by '/home/sean/linux-kernel-module-cheat/out/buildroot/build/default/x86_64/build/glibc-custom/build/elf/soinit.os'. Stop." 3 2021-01-19 2022-09-18
[email protected] 1 2021-12-11 2022-09-26
zhimi.fan.fa1, zhimi.fan.fb1 2 2022-03-05 2022-06-28
Form.Item + DatePicker.WeekPicker 无法设置值 2 2022-02-18 2022-09-22
0.5.3版本IOS无法运行 2 2020-04-23 2022-01-11
Stylesheets not working with email layout on haml 1 2021-11-17 2022-08-31
[Migration] Issue in migrating APIs with empty scopes 0 2022-02-14 2022-07-28
Supanel record order is not corrected 0 2022-07-01 2022-09-09
[DOC] mdspan/mdarray quick-start tutorial 4 2022-05-16 2022-08-21
converting bag files to image frames 7 2022-06-23 2022-09-23
Error in mounted hook: "TypeError: Cannot read properties of undefined (reading 'resourceAreaWidth') 1 2022-06-10 2022-09-17
Cannot call vkDestroyRenderPass on VkRenderPass 0x120000000012[] that is currently in use by a command buffer. The Vulkan spec states: All submitted commands that refer to renderPass must have completed execution 1 2021-08-28 2022-09-15
Greek accented characters are missing 3 2016-03-15 2022-09-26
qtplasma does not work on qt5 version >=5.15.6 0 2021-12-30 2022-08-09
Missing from lean 4: auto_params in structure fields 2 2021-07-16 2022-09-26
layers/GC: FD leak somewhere 2 2022-05-05 2022-09-13
Lost values on JSON.stringified formatted errors if schema contains array of objects 1 2022-05-03 2022-09-08
Ghost biking 1 2021-12-27 2022-01-15
[自动无缝翻页] 希望添加功能: 在页面右下角插入一个返回顶部的按钮 1 2022-05-17 2022-09-17
When I use earphone in pixel experience a12 based coustom rom screen stops working and turned in black 1 2022-01-05 2022-09-20
Intl.ListFormat() constructor article: Instructions for object containing style and type are combative with the example 1 2022-04-20 2022-09-17
fix: Could not resolve all artifacts for configuration ':app:productionReleaseRuntimeClasspath' 9 2021-03-07 2022-09-26
request: Flutter_Riverpod integration 2 2021-03-13 2022-08-08
Don't Automatically Prettify JSON Data in Log 1 2017-11-01 2022-09-19
arm 11 (core 0 error 1 2022-02-10 2022-09-18
Flaky `test_create_metadata_file` 5 2021-08-18 2022-09-26
How can I output profiler data for using FlameGraph visual? 0 2019-12-20 2022-08-30
Add documentation for DPG Credentials 2 2022-03-17 2022-09-17
Unable to install zipline in window, tried with Python versions - 3.6, 3.5 and 3.7 0 2022-04-07 2022-09-10
How to verify Binary Releases? 0 2022-03-11 2022-09-23
Helix open JS file with `typescript-language-server` crash 9 2021-11-10 2022-09-25
Backlink: remove "variation selection" character (U+FE0E)? 2 2022-08-02 2022-08-29
Can't create counter with negative initial value 8 2022-06-27 2022-08-11
CWL: Manage produced files 2 2018-08-25 2022-09-18
Using mergeDirs can defeat caching 1 2018-09-10 2022-09-18
Fatal Exception: java.lang.IllegalStateException 13 2021-01-27 2022-07-01
Windows style newline used on linux 2 2021-06-02 2022-09-19
Change the link in github 2 2022-02-13 2022-09-25
LayerNorm2d causes the inconsistency of output between frameworks 4 2022-05-06 2022-09-26
Cudnn version 2 2019-08-26 2022-01-07
🧐[问题] 使用 kong 代理到 nginx + index.html 时 301 重定向的结果和期望不同 1 2021-11-17 2022-07-30
Inability to avoid Kafka connection in unit tests 5 2022-02-27 2022-09-26