Readonly reference to an array is not honored when inside v-for #13087
Labels
🔨 p3-minor-bug
Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.
regression
Vue version
3.5.13
Link to minimal reproduction
https://play.vuejs.org/#eNp9kdFPwjAQxv+VS1+ABIcEfcFBooYHfVCjvlljlu0Gxa1t2m6OLPvfvXYBITG89e779bvv2pbdah3VFbI5i21qhHZg0VV6yaUotTIOWjCYZEoWO+ggN6qEAfGDmxMgP9G45DJV0jpIld7B4uAwJHL40UIzhyl0n6MRuXAZT/rJNJMKh6UuEodUAcSZqKG+yJVZcFaCkMGRs2XbQhk1ZH0JXRdPCOv5zdRLYazvU+n9jzzZmDlL4XKxjrZWSVq89Tc5S1WpRYHmWTtB4TmbQ1C8lhSF+nkMPWcqHO/76QbT73/6W9v4HmcvBi2aGjk7aC4xa3S9vHp7wobOB7FUWVUQfUZ8RauKymfssbtKZhT7iAtpH8LvCLl+t6vGobT7pXxQT3aB54x+7P7M6n9xZ9FVuMdlR6/4VaPxnvSAs+g6ms5Y9wtIl8Jq
Steps to reproduce
Create a readonly reference to a reference of an array of objects.
In the template, iterate over the reference array using
v-for
, while attempting to modify the current element, for instance, inside a child component setup function or directly in the template as follows.What is expected?
Modification should be disallowed as the reference is a readonly one.
What is actually happening?
Modification is permitted. Data is mutated. No error or waring issued.
System Info
Any additional comments?
This observation only occurs when
readonly()
is passed a reference. It doesn't happend if the array is passed directly toreadonly()
.The text was updated successfully, but these errors were encountered: