Skip to content

Commit b9e3b35

Browse files
Aaron-zonKiritaniAyakaveaba
authored
Update: translate src/guide/built-ins/transition.md (#884)
* Update: translate src/guide/built-ins/transition.md translate: Transitions with the Key Attribute * Update src/guide/built-ins/transition.md Co-authored-by: Ayaka <[email protected]> * Update src/guide/built-ins/transition.md Co-authored-by: Ayaka <[email protected]> * Update src/guide/built-ins/transition.md Co-authored-by: Ayaka <[email protected]> --------- Co-authored-by: Ayaka <[email protected]> Co-authored-by: Godpu <[email protected]>
1 parent 2be665e commit b9e3b35

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/guide/built-ins/transition.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -583,11 +583,11 @@ export default {
583583

584584
你也可以根据你的组件的当前状态在 JavaScript 过渡钩子中应用不同的行为。最后,创建动态过渡的终极方式还是创建[可复用的过渡组件](#reusable-transitions),并让这些组件根据动态的 props 来改变过渡的效果。掌握了这些技巧后,就真的只有你想不到,没有做不到的了。
585585

586-
## Transitions with the Key Attribute {#transitions-with-the-key-attribute}
586+
## 使用 Key Attribute 过渡 {#transitions-with-the-key-attribute}
587587

588-
<!-- TODO: translation -->Sometimes you need to force the re-render of a DOM element in order for a transition to occur.
588+
有时为了触发过渡,你需要强制重新渲染 DOM 元素。
589589

590-
Take this counter component for example:
590+
以计数器组件为例:
591591

592592
<div class="composition-api">
593593

@@ -638,16 +638,16 @@ export default {
638638

639639
</div>
640640

641-
If we had excluded the `key` attribute, only the text node would be updated and thus no transition would occur. However, with the `key` attribute in place, Vue knows to create a new `span` element whenever `count` changes and thus the `Transition` component has 2 different elements to transition between.
641+
如果不使用 `key` attribute,则只有文本节点会被更新,因此不会发生过渡。但是,有了 `key` 属性,Vue 就知道在 `count` 改变时创建一个新的 `span` 元素,因此 `Transition` 组件有两个不同的元素在它们之间进行过渡。
642642

643643
<div class="composition-api">
644644

645-
[Try it in the Playground](https://play.vuejs.org/#eNp9UsFu2zAM/RVCl6Zo4nhYd/GcAtvQQ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sh8dAt4KcnXJR+D3S16X07a9veKD3KdnZba+J/UbyJ+Zl0IyF9rk3Wxr7jJenvcvnrcz+PtweItKuZ1Np0MScMp8zOvkvb1j/P+776jrX0UbZ9A+fYSTP)
646646

647647
</div>
648648
<div class="options-api">
649649

650-
[Try it in the Playground](https://play.vuejs.org/#eNp9U8tu2zAQ/JUFTwkSyw6aXlQ7QB85pIe2aHPUhZHWDhOKJMiVYtfwv3dJSpbbBgEMWJydndkdUXvx0bmi71CUYhlqrxzdVAa3znqCBtey0wT7ygA0kuTZeX4G8EidN+MJoLadoRKuLkdAGULfS12C6bSGDB/i3yFx2tiAzaRIjyoUYxesICDdDaczZq1uJrNETY4XFx8G5Uu4WiwW55PBA66txy8YyNvdZFNrlP4o/Jdpbq4M/5bzYxZ8IGydloR8Alg2qmcVGcKqEi9eOoe+EqnExXsvTVCkrBkQxoKTBspn3HFDmprp+32ODA4H9mLCKDD/R2E5Zz9+Ws5PpuBjoJ1GCLV12DASJdKGa2toFtRvLOHaY8vx8DrFMGdiOJvlS48sp3rMHGb1M4xRzGQdYU6REY6rxwHJGdJxwBKsk7WiHSyK9wFQhqh14gDyIVjd0f8Wa2/bUwOyWXwQLGGRWzicuChvKC4F8bpmrTbFU7CGL2zqiJm2Tmn03100DZUox5ddCam1ffmaMPJd3Cnj9SPWz6/gT2EbsUr88Bj4VmAljjWSfoP88mL59tc33PLzsdjaptPMfqP4E1MYPGOmfepMw2Of8NK0d238+JTZ3IfbLSFnPSwVB53udyX4q/38xurTuO+K6/Fqi8MffqhR/A==)
650+
[在演练场中尝试一下](https://play.vuejs.org/#eNp9U8tu2zAQ/JUFTwkSyw6aXlQ7QB85pIe2aHPUhZHWDhOKJMiVYtfwv3dJSpbbBgEMWJydndkdUXvx0bmi71CUYhlqrxzdVAa3znqCBtey0wT7ygA0kuTZeX4G8EidN+MJoLadoRKuLkdAGULfS12C6bSGDB/i3yFx2tiAzaRIjyoUYxesICDdDaczZq1uJrNETY4XFx8G5Uu4WiwW55PBA66txy8YyNvdZFNrlP4o/Jdpbq4M/5bzYxZ8IGydloR8Alg2qmcVGcKqEi9eOoe+EqnExXsvTVCkrBkQxoKTBspn3HFDmprp+32ODA4H9mLCKDD/R2E5Zz9+Ws5PpuBjoJ1GCLV12DASJdKGa2toFtRvLOHaY8vx8DrFMGdiOJvlS48sp3rMHGb1M4xRzGQdYU6REY6rxwHJGdJxwBKsk7WiHSyK9wFQhqh14gDyIVjd0f8Wa2/bUwOyWXwQLGGRWzicuChvKC4F8bpmrTbFU7CGL2zqiJm2Tmn03100DZUox5ddCam1ffmaMPJd3Cnj9SPWz6/gT2EbsUr88Bj4VmAljjWSfoP88mL59tc33PLzsdjaptPMfqP4E1MYPGOmfepMw2Of8NK0d238+JTZ3IfbLSFnPSwVB53udyX4q/38xurTuO+K6/Fqi8MffqhR/A==)
651651

652652
</div>
653653

0 commit comments

Comments
 (0)