V-once 是否也适用于应用元素的子节点?
Does V-once also apply do child nodes of the applied element?
V-once是否也适用于被应用元素的子节点?
在文档中他们说遵循
You can also perform one-time interpolations that do not update on data change by using the v-once directive, but keep in mind this will also affect any other bindings on the same node.
-> source
在同一个节点上到底意味着什么?
<div id="one" v-once>
This will never change {{ msg }}
<span>But will it also never change in the child node?{{ msg }}</span>
</div>
<div id="two">
It seems like div two is not on the same node.
</div>
答案是"yes, it applies to children"。
V-once是否也适用于被应用元素的子节点?
在文档中他们说遵循
You can also perform one-time interpolations that do not update on data change by using the v-once directive, but keep in mind this will also affect any other bindings on the same node. -> source
在同一个节点上到底意味着什么?
<div id="one" v-once>
This will never change {{ msg }}
<span>But will it also never change in the child node?{{ msg }}</span>
</div>
<div id="two">
It seems like div two is not on the same node.
</div>
答案是"yes, it applies to children"。