search

Home  >  Q&A  >  body text

javascript - How to reference different css styles based on variables in vuejs

Required to change the previous project to vue framework. Now we have css and everything. Now I want to introduce different css files based on variables. Similar to the logical effect in if(){//import from ''xxx.css}. I would like to ask everyone, can it be implemented in the vue framework, or through webpack?

曾经蜡笔没有小新曾经蜡笔没有小新2689 days ago623

reply all(1)I'll reply

  • 三叔

    三叔2017-07-05 10:39:08

    Use webpack code splitting and write like this when quoting
    `
    require.ensure('xxx.css')
    `

    reply
    0
  • Cancelreply