Closed
Description
Version
2.6.10
Reproduction link
https://codepen.io/xiangyuecn/pen/eYmmPNP
Steps to reproduce
- Look at the test code running interface.
OnceMsg
area should have been static, but it is not! - Look at the
Test 3
part of the test code. It's exactly the same as theTest 2
part, but their performance is not the same. - Similar to this kind of code, they are the same, but the results are different:
<div>
<template v-once>[{{ getTime() }}] {{ name }}</template>
<span v-once>[{{ getTime() }}] {{ name }}</span>
</div>
<div v-for="obj,idx in logs" :key="idx">
<div>
<template v-once>[{{ getTime() }}] {{ obj.msg }}</template>
<span v-once>[{{ getTime() }}] {{ obj.msg }}</span>
</div>
</div>
Use
<template v-once>
because I don't want to use more than onespan
, which will damage the DOM structure.
What is expected?
<template v-once> in v-for
should be consistent with <template v-once> not in v-for
, OnceMsg
area should have been static.
What is actually happening?
<template v-once> in v-for
and <template v-once> not in v-for
are inconsistent, The leftmost time of OnceMsg
area will change with the cycle.
Metadata
Metadata
Assignees
Labels
No labels