vue单页面模板说明文档(1)
Introduction
This boilerplate is targeted towards large, serious projects and assumes you are somewhat familiar with Webpack and vue-loader
. Make sure to also read vue-loader
's documentation for common workflow recipes.
If you just want to try out vue-loader
or whip out a quick prototype, use the webpack-simple template instead.
Quickstart
To use this template, scaffold a project with vue-cli. It is recommended to use npm 3+ for a more efficient dependency tree.
$ npm install -g vue-cli
$ vue init webpack my-project
$ cd my-project
$ npm install
$ npm run dev
Project Structure
.
├── build/ # webpack config files
│ └── ...
├── config/
│ ├── index.js # main project config
│ └── ...
├── src/
│ ├── main.js # app entry file
│ ├── App.vue # main app component
│ ├── components/ # ui components
│ │ └── ...
│ └── assets/ # module assets (processed by webpack)
│ └── ...
├── static/ # pure static assets (directly copied)
├── test/
│ └── unit/ # unit tests
│ │ ├── specs/ # test spec files
│ │ ├── index.js # test build entry file
│ │ └── karma.conf.js # test runner config file
│ └── e2e/ # e2e tests
│ │ ├── specs/ # test spec files
│ │ ├── custom-assertions/ # custom assertions for e2e tests
│ │ ├── runner.js # test runner script
│ │ └── nightwatch.conf.js # test runner config file
├── .babelrc # babel config
├── .postcssrc.js # postcss config
├── .eslintrc.js # eslint config
├── .editorconfig # editor config
├── index.html # index.html template
└── package.json # build scripts and dependencies
build/
This directory holds the actual configurations for both the development server and the production webpack build. Normally you don't need to touch these files unless you want to customize Webpack loaders, in which case you should probably look at build/webpack.base.conf.js
.
config/index.js
This is the main configuration file that exposes some of the most common configuration options for the build setup. See API Proxying During Development and Integrating with Backend Framework for more details.
src/
This is where most of your application code will live in. How to structure everything inside this directory is largely up to you; if you are using Vuex, you can consult the recommendations for Vuex applications.
static/
This directory is an escape hatch for static assets that you do not want to process with Webpack. They will be directly copied into the same directory where webpack-built assets are generated.
See Handling Static Assets for more details.
test/unit
Contains unit test related files. See Unit Testing for more details.
test/e2e
Contains e2e test related files. See End-to-end Testing for more details.
index.html
This is the template index.html
for our single page application. During development and builds, Webpack will generate assets, and the URLs for those generated assets will be automatically injected into this template to render the final HTML.
package.json
The NPM package meta file that contains all the build dependencies and build commands.
Build Commands
All build commands are executed via NPM Scripts.
npm run dev
Starts a Node.js local development server. See API Proxying During Development for more details.
- Webpack +
vue-loader
for single file Vue components. - State preserving hot-reload
- State preserving compilation error overlay
- Lint-on-save with ESLint
- Source maps
npm run build
Build assets for production. See Integrating with Backend Framework for more details.
- JavaScript minified with UglifyJS.
- HTML minified with html-minifier.
- CSS across all components extracted into a single file and minified with cssnano.
- All static assets compiled with version hashes for efficient long-term caching, and a production
index.html
is auto-generated with proper URLs to these generated assets.
npm run unit
Run unit tests in PhantomJS with Karma. See Unit Testing for more details.
- Supports ES2015+ in test files.
- Supports all webpack loaders.
- Easy mock injection.
npm run e2e
Run end-to-end tests with Nightwatch. See End-to-end Testing for more details.
- Run tests in multiple browsers in parallel.
- Works with one command out of the box:
- Selenium and chromedriver dependencies automatically handled.
- Automatically spawns the Selenium server.
vue单页面模板说明文档(1)的更多相关文章
- vue单页面模板说明文档(3)
Environment Variables Sometimes it is practical to have different config values according to the env ...
- vue单页面模板说明文档(2)
Linter Configuration This boilerplate uses ESLint as the linter, and uses the Standard preset with s ...
- vue render {} 对象 说明文档
Vue学习笔记进阶篇——Render函数 http://www.mamicode.com/info-detail-1906336.html 深入data object参数 有一件事要注意:正如在模板语 ...
- Vue 单文件元件 — vTabs
简书原文 这是我做了第二个单文件元件 第一个在这里vCheckBox 这次这个叫vTabs,用于操作标签页 演示DEMO 演示DEMO2 - 子组件模式及别名 演示DEMO3 - 极简模式 示例: h ...
- webpack入坑之旅(五)加载vue单文件组件
这是一系列文章,此系列所有的练习都存在了我的github仓库中vue-webpack,在本人有了新的理解与认识之后,会对文章有不定时的更正与更新.下面是目前完成的列表: webpack入坑之旅(一)不 ...
- SWFUpload 2.5.0版 官方说明文档 中文翻译版
原文地址:http://www.cnblogs.com/youring2/archive/2012/07/13/2590010.html#setFileUploadLimit SWFUpload v2 ...
- 《暗黑世界GM管理后台系统》部署+功能说明文档
http://www.9miao.com/product-10-1073.html <暗黑世界GM管理后台系统>部署+功能说明文档 <暗黑世界GM管理后台系统>部署+功能说明文 ...
- BasicExcel说明文档
BasicExcel说明文档 BasicExcel原始链接:http://www.codeproject.com/Articles/13852/BasicExcel-A-Class-to-Read-a ...
- 处理 Vue 单页面应用 SEO 的另一种思路
vue-meta-info 官方地址: monkeyWangs/vue-meta-info (设置vue 单页面meta info信息,如果需要单页面SEO,可以和 prerender-spa-plu ...
随机推荐
- 力扣算法题—069x的平方根
实现 int sqrt(int x) 函数. 计算并返回 x 的平方根,其中 x 是非负整数. 由于返回类型是整数,结果只保留整数的部分,小数部分将被舍去. 示例 1: 输入: 4 输出: 2 示例 ...
- 基于python的Selenium使用小结
之前介绍过基于Unittest和TestNG自动化测试框架,然而基于Web端的测试的基础框架是需要Selenium做主要支撑的,这里边给大家介绍下Web测试核心之基于Python的Selenium 一 ...
- 《Java大学教程》—第17章 Java聚焦类框架
由所有聚焦类构成,在java.util包中,包含三个重要接口:* List列表:元素为单个对象,元素在列表中是有序.可重复* Set集合:元素为单个对象,元素在集合中无序.不可重复* ...
- JavaScript如何计算两个日期间的时间差
<script type="text/javascript"> /* * 获得时间差,时间格式为 年-月-日 小时:分钟:秒 或者 年/月/日 小时:分钟:秒 * 其中 ...
- [1] 从零开始 TensorFlow 学习
计算图的基本概念 TensorFlow 的名字中己经说明了它最重要的两个概念一一Tensor 和 Flow Tensor: 张量(高阶数组,矩阵为二阶张量,向量为一阶张量,标量为零阶张量) Flow: ...
- 转://oracle Wallet在expdp/impdp中使用场景
oracle Wallet的使用(即内部加密技术TDE(Transparent Data Encryption )) 1. TDE是Oracle10gR2中推出的一个新功能,使用时要保证Oracle版 ...
- 【转】Android hdpi ldpi mdpi xhdpi xxhdpi适配详解
1.了解几个概念(1)分辨率.分辨率就是手机屏幕的像素点数,一般描述成屏幕的“宽×高”,安卓手机屏幕常见的分辨率有480×800.720×1280.1080×1920等.720×1280表示此屏幕在宽 ...
- 第9章 Java中的线程池 第10章 Exector框架
与新建线程池相比线程池的优点 线程池的分类 ThreadPoolExector参数.执行过程.存储方式 阻塞队列 拒绝策略 10.1 Exector框架简介 10.1.1 Executor框架的两级调 ...
- VsCode云端版本
VsCode的云端版与客户端简直是一模一样. 官网地址为:https://coder.com/ 安装命令: docker run -t -p 127.0.0.1:8443:8443 -v " ...
- Mac定时关机、重启、休眠命令行
由于一些原因,需要在不上班的时间去连公司电脑来做一些事.所以公司电脑很少关机.但是在没多天没有关机以后电脑会变得很卡.所以现在每天早上去公司的第一件事情就是先重启一下电脑.人工重启,太不符合程序员的作 ...