search

Home  >  Q&A  >  body text

javascript - How to handle large sections of static HTML in vue single file development

When developing a single vue file, if there is a lot of static HTML, such as static content such as guidelines and protocols. If you also use .vue files, they will eventually be packaged into js, ​​resulting in a much larger file after packaging. How did you handle it?

为情所困为情所困2747 days ago471

reply all(1)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-19 10:37:31

    Control in the route file to download each .vue file on demand like this

    const Home = resolve => {
      require.ensure(['../components/base/Home.vue'],() => {
        resolve(require('../components/base/Home.vue'))
      },'')
    }

    reply
    0
  • Cancelreply