• 快速搭建Vue项目


    快速搭建Vue项目

    第一次安装vue项目
    Vue推荐开发环境
    Node.js 6.2.0、npm 3.8.9、webpack 1.13、vue-cli 2.5.1、webstrom2016

    安装环境:

    安装nodejs
    可以在终端里下载,但是不推荐,npm的版本会报错
    去nodejs官网下载即可,地址:http://nodejs.cn/中文网

    安装vue淘宝镜像
    npm install -g vue –registry=https://registry.npm.taobao.org

    安装webpack
    npm install webpack -g

    安装vue脚手架
    npm install vue-cli -g

    --------------------
    注:如果第二次编写新的vue项目,在这里开始就可以了
    --------------------
    根据模板创建项目
    vue init webpack 项目名字<项目名字不能用中文>

    会有一些初始化的设置,如下输入:
    Target directory exists. Continue? (Y/n) 直接回车默认(然后会下载 vue2.0模板,这里可能需要连代理)
    Project name (vue-test) 直接回车默认
    Project description (A Vue.js project) 直接回车默认
    Author 直接回车默认
    Use ESLint to lint your code? n
    pick an eslint preset. 默认Standard
    setup unit tests with karma + mocha?No(单元测试不需要)
    setup e2e tests with Nightwatch?No(单元测试不需要)

    进入项目
    打开终端
    cd 项目名字

    安装项目依赖
    npm install

    安装 vue 路由模块vue-router和网络请求模块vue-resource –save-dev 是你开发时候依赖的东西,–save 是你发布之后还依赖的东西
    npm install vue-router vue-resource –save

    启动项目
    npm run dev

    发布项目
    npm run build

    目前基础搭建这里应该暂时可以了

  • 相关阅读:
    [leetcode] Palindrome Number
    [leetcode] Find Minimum in Rotated Sorted Array
    [leetcode] Word Search
    [leetcode] Construct Binary Tree from Preorder and Inorder Traversal
    [leetcode] Flatten Binary Tree to Linked List
    [leetcode] Recover Binary Search Tree
    [leetcode] Unique Binary Search Trees II
    [leetcode summary] Dynamic Programming
    [leetcode] Generate Parentheses
    [leetcode summary] Backtracing
  • 原文地址:https://www.cnblogs.com/zdz8207/p/vue-add-project.html
Copyright © 2020-2023  润新知