码迷,mamicode.com
首页 > 移动开发 > 详细

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

时间:2016-12-06 03:57:13      阅读:277      评论:0      收藏:0      [点我收藏+]

标签:cli   ready   scratch   default   outer   back   bsp   ase   start   

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

标签:cli   ready   scratch   default   outer   back   bsp   ase   start   

原文地址:http://www.cnblogs.com/Answer1215/p/6136096.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!