美文网首页
vue-cli2的单页面应用构建

vue-cli2的单页面应用构建

作者: afeng_1234 | 来源:发表于2018-11-17 14:59 被阅读0次
前提全局安装 vue-cli :
npm install vue-cli -g

创建项目

vue init webpack my-project

? Project name (test)        // 项目名称
? Project name test
? Project description (A Vue.js project)        // 项目描述
? Project description A Vue.js project
? Author (villelee)        // 作者
? Author villelee
? Vue build (Use arrow keys)        // 开始选项设置
? Vue build standalone
? Install vue-router? (Y/n) Y        // 安装路由
? Install vue-router? Yes
? Use ESLint to lint your code? (Y/n) Y        // 是否使用ESlint统一代码风格
? Use ESLint to lint your code? Yes
? Pick an ESLint preset (Use arrow keys)
> Standard (https://github.com/standard/standard)
? Pick an ESLint preset Airbnb
? Set up unit tests (Y/n) n        // 是否安装单元测试
? Set up unit tests No
? Setup e2e tests with Nightwatch? (Y/n) n        // 是否安装e2e测试
? Setup e2e tests with Nightwatch? No
? Should we run `npm install` for you after the project has been created? (recom
? Should we run `npm install` for you after the project has been created? (recom
mended) npm

项目创建完成后,安装基础模块

cd myproject;
npm install;

最后 运行

npm run dev

如果项目可以正常启动,即可继续安装vue的辅助工具(--save 也可以简写 -d)

npm install vue-router --save (路由管理模块)
npm install vuex --save (状态管理模块)
npm install axios --save (网路请求模块)

相关文章

  • vue-cli2的单页面应用构建

    前提全局安装 vue-cli : 创建项目 项目创建完成后,安装基础模块 最后 运行 如果项目可以正常启动,即可继...

  • Vue-router2.0学习笔记

    Vue.js的一大特色就是构建单页面应用十分方便,既然要方便构建单页面应用那么自然少不了路由,vue-router...

  • vue-router路由(非常重要)

    Vue.js的一大特色就是 构建单页面应用十分方便 ,既然要方便构建单页面应用那么自然少不了路由,vue-rou...

  • vue-router2.0学习笔记

    Vue.js的一大特色就是构建单页面应用十分方便,既然要方便构建单页面应用那么自然少不了路由,vue-router...

  • 我不知道

    # vue-cli构建单页面应用(个人博客) -------------------------- **[项目地址...

  • 测试之vuejs

    用vuejs 构建一个单页面应用,单页面应用页面包括,头部,左侧导航,中间内容区域,如图1所示: 要求:1.当左侧...

  • keepAlive使用方法

    vue单页面,多路由,前进刷新,后退不刷新 目的:vue-cli构建的vue单页面应用,某些特定的页面,实现前进刷...

  • AngularJS

    AngularJS 是什么 概念:AngularJS主要用于构建单页面Web应用,是一种构建动态Web应用的结构化...

  • webpack4构建多页应用,了解一下

    用webpack构建多页应用可以有2种思路,多页面单配置 vs. 多页面多配置。本例子采用多页面单配置,即在单页应...

  • Vue-router 懒加载 - 异步组件

    当在使用 vue-router 来构建一个 vue 单页面应用的时候,如果应用的路有页面非常多的时候,应用打包后 ...

网友评论

      本文标题:vue-cli2的单页面应用构建

      本文链接:https://www.haomeiwen.com/subject/opzbfqtx.html