[Vue] Build Vue.js Apps with the Vue-CLI and Nuxt.js

Posted Answer1215

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[Vue] Build Vue.js Apps with the Vue-CLI and Nuxt.js相关的知识,希望对你有一定的参考价值。

The vue-cli allows you to easily start up Vue projects from the command line while Nuxt.js enables a page-based routing system that follows your file structure. Combine these two projects and you‘ll have a Vue app created from scratch deployed in a matter of minutes.

 

Install:

npm i -g vue-cli

 

Setup:

vue init nuxt/starter basic-vue-proejct
cd vue-basic-project
yarn

 

Run:

npm run dev

 

Nuxt.js has already server-side rendering setup, which is pretty cool!

 

A basic two way binding:

<template>
  <section class="container">
    <h1 class="title">
      {{message}}
    </h1>
    <input v-model="message">
    <router-link class="button" to="/about">
      About page
    </router-link>
  </section>
</template>

<script>
  export default {
    data(){
      return {
        message: "Hello World!"
      }
    }
  }
</script>

 

Github

以上是关于[Vue] Build Vue.js Apps with the Vue-CLI and Nuxt.js的主要内容,如果未能解决你的问题,请参考以下文章

由于 unsafe-eval,Vue.js 3 扩展在使用“vue-cli-service build”时中断

Vue.js源码学习——项目构建

Vue.js 项目在“npm build”期间出现 404 错误并在 Apache Tomcat 中提供服务

vue.js

使用 npm run build 后如何正确查看我的 Vue.js 应用程序

Vue js Vue-cli 执行“npm run build”,将图像不透明度的 css 编译为 1%