This time I will show you how vue and vue-i18n realize the multi-language switching of background data. How vue and vue-i18n realize the multi-language switching of background data.Notes What are they? Here are actual cases. Let’s take a look.
In the XXX.js fileDefine the function:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
array;
The above method is to traverse the data obtained through the map function, using this.$ t() corresponds the value of items to the value in the translation resource, thereby realizing multi-language switching of background data;Part of the data in the en.json translation resource:
1 2 3 4 5 |
|
How to update the array with $set in vue.js
How to move the array in vue.js Position and update the view
The above is the detailed content of How vue and vue-i18n implement multi-language switching of background data. For more information, please follow other related articles on the PHP Chinese website!