安装

//安装nuxt脚手架
yarn add -D create-nuxt-app
//创建一个名字为project的项目
npx create-nuxt-app project

启动

yarn dev
// 或
npm run dev

打包

yarn build
//启动打包后的服务
yarn start
<template>
  <h1>{{ title }}</h1>
</template>

<script>
  export default {
    data() {
      return {
        title: 'Hello World!'
      }
    },
    head() {
      return {
        title: this.title,
        meta: [
          {
            hid: 'description',
            name: 'description',
            content: 'My custom description'
          }
        ]
      }
    }
  }
</script>