Closed alexzhang1030 closed 3 months ago
>=3.4.15, 3.4.13
https://play.vuejs.org/#eNp9kk1PwzAMhv9KlAudKN0m4DK2STDtMA6AAHGKhKrO3TratEqcbVLV/46T7KNFaKc29uvHr53U/LGqoq0BPuJjnaisQqYBTTUVMiuqUiGrmYI0ZElZVAZhGbJdjMn68JmnKSTIGpaqsmBXBLoSUsiklBqpxEhkE1sfDHs2TuiFRFDbOA+CHptMWS0k88KIggbY9YQNhWxCNhwMBq7Iw1JJpCCKolittCsl2bmTN/flEJPT+dAklUGrRa9FVaBALkHNWlZ919Z4XautTp73YOMdUHcUwo37fre0VTogFFUeI9DpDByxuv4zR9N48o1H+zU5Xde21Y37LSoPOWoaMM1W0UaXki7XmRfcNshyUK8VZrQAwQlnMzYX53m5e3YxVAbCYzxZQ/LzT3yj9zYm+JsCTXcKgp9ySLcE6NPzjxfY0/8pWZRLk5P6QvIddJkb69HLnoxcku2WzrlduCeaydWnnu8RpD4OZY1aZeP0gtPDnF0Y/Wz3NrpzdXRvtMXvLSjLpAVSIhre8+YXrugTTQ==
See re-render count
re-render
re-render count should always be 1, you can choose vue@3.4.14 and see.
1
If vue@^3.4.15, the re-render count always increases even if the computed value is unchanged.
No response
@johnsoncodehk implemented this feature in PR #5912
In your case, you access rerenderCount and mutate it immediately, this makes the effect always dirty, and then once you mutate the dependencies chain, this effect will always re-calc which is expected.
rerenderCount
effect
Vue version
>=3.4.15, 3.4.13
Link to minimal reproduction
https://play.vuejs.org/#eNp9kk1PwzAMhv9KlAudKN0m4DK2STDtMA6AAHGKhKrO3TratEqcbVLV/46T7KNFaKc29uvHr53U/LGqoq0BPuJjnaisQqYBTTUVMiuqUiGrmYI0ZElZVAZhGbJdjMn68JmnKSTIGpaqsmBXBLoSUsiklBqpxEhkE1sfDHs2TuiFRFDbOA+CHptMWS0k88KIggbY9YQNhWxCNhwMBq7Iw1JJpCCKolittCsl2bmTN/flEJPT+dAklUGrRa9FVaBALkHNWlZ919Z4XautTp73YOMdUHcUwo37fre0VTogFFUeI9DpDByxuv4zR9N48o1H+zU5Xde21Y37LSoPOWoaMM1W0UaXki7XmRfcNshyUK8VZrQAwQlnMzYX53m5e3YxVAbCYzxZQ/LzT3yj9zYm+JsCTXcKgp9ySLcE6NPzjxfY0/8pWZRLk5P6QvIddJkb69HLnoxcku2WzrlduCeaydWnnu8RpD4OZY1aZeP0gtPDnF0Y/Wz3NrpzdXRvtMXvLSjLpAVSIhre8+YXrugTTQ==
Steps to reproduce
See
re-render
countWhat is expected?
re-render
count should always be1
, you can choose vue@3.4.14 and see.What is actually happening?
If vue@^3.4.15, the
re-render
count always increases even if the computed value is unchanged.System Info
No response
Any additional comments?
@johnsoncodehk implemented this feature in PR #5912