Is it possible to compile Vue.js templates to static HTML and CSS files?

后端 未结 4 905
时光取名叫无心
时光取名叫无心 2021-02-05 06:33

Recently I\'ve fallen in love with Vue.js\'s single file components. It\'s so much nicer to have a component\'s template and styles close to each other, and I\'m finding I write

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-05 07:15

    There are many plugins.

    Install Vue Meta for smaller projects. If you only have a few static pages I'd recommend Vue meta and then creating a few HTML files for the same pages by hand or using a prerendering service.

    The problem with prerendering is its only available with certain setups and can be difficult to install if you don't already have the ideal setup requiring you to rebuilt it over again for optimizing SEO and prerendering in Vue.js

    For this reason I recommend the following:

    For small apps: Vue Meta

    npm install vue-meta --save

    For medium to large apps with dynamic rendering:

    nuxt.js with SSR (Server Side Rendering):

    See this video search on YouTube for more information on how to build a web app with nuxt.js and SSR:

    https://www.youtube.com/results?search_query=nuxt+js+and+ssr

提交回复
热议问题