原文:http://michaelnthiessen.com/force-re-render/
标题: The correct way to force Vue to re-render a component

The best way to force Vue to re-render a component is to set a :key on the component. When you need the component to be re-rendered, you just change the value of the key and Vue will re-render the component.

  • The horrible way: reloading the entire page
  • The terrible way: using the v-if hack
  • The better way: using Vue’s built-in forceUpdate method
  • The best way: key-changing on your component

标签: re-render

添加新评论