Answer the question
In order to leave comments, you need to log in
How to make vue 2 cli + i18n word translation animation?
As you know, when changing the language through i18n, the length of the word changes. I want to animate the change in length. For this I have a parent block whose width I change using
watch: {
"$i18n.locale": () => {
document.getElementById("nav").parentElement.style.width =
(100 * document.getElementById("nav").scrollWidth) / getMinSide() +
"vmin";
},
},
function getMinSide() {
if (
document.documentElement.clientWidth < document.documentElement.clientHeight
) {
return document.documentElement.clientWidth;
} else {
return document.documentElement.clientHeight;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question