[Vuejs]-Propagating $forceUpdate to slot contents

0👍

The correct and well-working way was to do the following:

  1. Define a reactive variable in the $locale service called currentLocale
  2. Update the contents of this value when the user changes their preferred locale
  3. Reference this value in the $t function

And voila, Vue reactivity makes sure every call to $t is updated whenever currentLocale changes. No need for dirty hacks with $forceUpdate.

Leave a comment