[Vuejs]-Vuejs SPA need to load css for ltr and rtl based on language

0👍

You could have language specific CSS inclusions <link href="..." /> from the respective components for EN and AR as shown below.

routes: [
    {
      path: '/en',
      name: 'Welcome EN...',
      component: WelcomeEN
    },
    {
      path: '/ar',
      name: 'Welcome AR...',
      component: WelcomeAR
    }
  ]

Do you think that would work for you ?

0👍

this is an example of conditional css loading inside a component

// change x to change color
const x = true;
if(x)
   require("./assets/style.css");
else
   require("./assets/stylegreen.css");

code snippet of conditional css loading in vue

Leave a comment