7bea0642 by simon

no message

1 parent 43c3bb1e
# root = true
# [*]
# charset = utf-8
# indent_style = space
# indent_size = 4
# end_of_line = lf
# insert_final_newline = true
# trim_trailing_whitespace = true
root = true;
[*]
# indent_style = tab
indent_style = space
# indent_size = 4
indent_size = 2
tab_width = 2
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
[*.{json,yml,wxml,html,vue,js}]
indent_style = tab
indent_size = 2
tab_width = 2
[README.md]
trim_trailing_whitespace = ignore
......@@ -970,9 +970,9 @@
"dev": true
},
"@vant/icons": {
"version": "1.1.7",
"resolved": "https://registry.npm.taobao.org/@vant/icons/download/@vant/icons-1.1.7.tgz",
"integrity": "sha1-KVYa3/+mp1DSedzNvpppt0OTTz8="
"version": "1.1.13",
"resolved": "https://registry.npm.taobao.org/@vant/icons/download/@vant/icons-1.1.13.tgz",
"integrity": "sha1-6ncpj08rGczHYQBQaKLHQ2CY5NQ="
},
"@vue/babel-helper-vue-jsx-merge-props": {
"version": "1.0.0",
......@@ -1942,13 +1942,6 @@
"integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=",
"dev": true
},
"asap": {
"version": "2.0.6",
"resolved": "https://registry.npm.taobao.org/asap/download/asap-2.0.6.tgz",
"integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=",
"dev": true,
"optional": true
},
"asn1": {
"version": "0.2.4",
"resolved": "http://registry.npm.taobao.org/asn1/download/asn1-0.2.4.tgz",
......@@ -6699,13 +6692,6 @@
"integrity": "sha1-Cpf7h2mG6AgcYxFg+PnziRV/AEM=",
"dev": true
},
"image-size": {
"version": "0.5.5",
"resolved": "https://registry.npm.taobao.org/image-size/download/image-size-0.5.5.tgz",
"integrity": "sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w=",
"dev": true,
"optional": true
},
"import-cwd": {
"version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/import-cwd/download/import-cwd-2.1.0.tgz",
......@@ -7244,6 +7230,11 @@
"resolved": "http://registry.npm.taobao.org/js-base64/download/js-base64-2.5.1.tgz",
"integrity": "sha1-Hvo57yxfeYC7F4St5KivLeMpESE="
},
"js-cookie": {
"version": "2.2.1",
"resolved": "https://registry.npm.taobao.org/js-cookie/download/js-cookie-2.2.1.tgz",
"integrity": "sha1-aeEG3F1YBolFYpAqpbrsN0Tpsrg="
},
"js-levenshtein": {
"version": "1.1.6",
"resolved": "https://registry.npm.taobao.org/js-levenshtein/download/js-levenshtein-1.1.6.tgz",
......@@ -7418,64 +7409,6 @@
"invert-kv": "^2.0.0"
}
},
"less": {
"version": "3.9.0",
"resolved": "https://registry.npm.taobao.org/less/download/less-3.9.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fless%2Fdownload%2Fless-3.9.0.tgz",
"integrity": "sha1-t1EcQ/N89X3Iff/ZiD7BISibFHQ=",
"dev": true,
"requires": {
"clone": "^2.1.2",
"errno": "^0.1.1",
"graceful-fs": "^4.1.2",
"image-size": "~0.5.0",
"mime": "^1.4.1",
"mkdirp": "^0.5.0",
"promise": "^7.1.1",
"request": "^2.83.0",
"source-map": "~0.6.0"
},
"dependencies": {
"clone": {
"version": "2.1.2",
"resolved": "https://registry.npm.taobao.org/clone/download/clone-2.1.2.tgz",
"integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=",
"dev": true
},
"mime": {
"version": "1.6.0",
"resolved": "https://registry.npm.taobao.org/mime/download/mime-1.6.0.tgz?cache=0&sync_timestamp=1560034758817&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmime%2Fdownload%2Fmime-1.6.0.tgz",
"integrity": "sha1-Ms2eXGRVO9WNGaVor0Uqz/BJgbE=",
"dev": true,
"optional": true
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz",
"integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=",
"dev": true,
"optional": true
}
}
},
"less-loader": {
"version": "5.0.0",
"resolved": "https://registry.npm.taobao.org/less-loader/download/less-loader-5.0.0.tgz",
"integrity": "sha1-SY3eOmxsT4h0WO6e0/CGoSrRtGY=",
"dev": true,
"requires": {
"clone": "^2.1.1",
"loader-utils": "^1.1.0",
"pify": "^4.0.1"
},
"dependencies": {
"clone": {
"version": "2.1.2",
"resolved": "https://registry.npm.taobao.org/clone/download/clone-2.1.2.tgz",
"integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=",
"dev": true
}
}
},
"levn": {
"version": "0.3.0",
"resolved": "https://registry.npm.taobao.org/levn/download/levn-0.3.0.tgz",
......@@ -9824,16 +9757,6 @@
"integrity": "sha1-foz42PW48jnBvGi+tOt4Vn1XLvg=",
"dev": true
},
"promise": {
"version": "7.3.1",
"resolved": "https://registry.npm.taobao.org/promise/download/promise-7.3.1.tgz",
"integrity": "sha1-BktyYCsY+Q8pGSuLG8QY/9Hr078=",
"dev": true,
"optional": true,
"requires": {
"asap": "~2.0.3"
}
},
"promise-inflight": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/promise-inflight/download/promise-inflight-1.0.1.tgz",
......@@ -12516,13 +12439,13 @@
}
},
"vant": {
"version": "1.6.21",
"resolved": "https://registry.npm.taobao.org/vant/download/vant-1.6.21.tgz",
"integrity": "sha1-7MdP1p/ND6EeQX5Q9XaEsFPgyzw=",
"version": "2.1.7",
"resolved": "https://registry.npm.taobao.org/vant/download/vant-2.1.7.tgz",
"integrity": "sha1-/lgbzo/yixP3pyc0OG+VRu2mtvs=",
"requires": {
"@babel/runtime": "^7.4.3",
"@vant/icons": "1.1.7",
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0-beta.3",
"@babel/runtime": "7.x",
"@vant/icons": "1.1.13",
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
"vue-lazyload": "1.2.3"
}
},
......@@ -12609,7 +12532,7 @@
},
"vue-lazyload": {
"version": "1.2.3",
"resolved": "https://registry.npm.taobao.org/vue-lazyload/download/vue-lazyload-1.2.3.tgz",
"resolved": "https://registry.npm.taobao.org/vue-lazyload/download/vue-lazyload-1.2.3.tgz?cache=0&sync_timestamp=1565348603567&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-lazyload%2Fdownload%2Fvue-lazyload-1.2.3.tgz",
"integrity": "sha1-kB+ewVx+bKeHgaK65KNDaGve2yw="
},
"vue-loader": {
......
......@@ -18,10 +18,11 @@
"co": "^4.6.0",
"core-js": "^2.6.5",
"glob": "^7.1.4",
"js-cookie": "^2.2.1",
"mockjs": "^1.0.1-beta3",
"postcss-px2rem": "^0.3.0",
"postcss-pxtorem": "^4.0.1",
"vant": "^1.6.21",
"vant": "^2.1.7",
"vue": "^2.6.10",
"vue-router": "^3.0.3",
"vuex": "^3.0.1"
......@@ -34,8 +35,6 @@
"babel-plugin-import": "^1.12.0",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"less": "^3.9.0",
"less-loader": "^5.0.0",
"node-sass": "^4.12.0",
"sass-loader": "^7.1.0",
"vue-template-compiler": "^2.6.10"
......
......@@ -4,7 +4,7 @@ module.exports = ({
file
}) => {
let remUnit;
// file.dirname是绝对地址,所以项目名,文件目录不能带 'vant'
// file.dirname是绝对地址,所以项目名,文件目录不能带 'vant'
if (file && file.dirname && file.dirname.indexOf("vant") > -1) {
remUnit = 37.5;
} else {
......@@ -17,4 +17,4 @@ module.exports = ({
browsers: ["last 20 versions", "android >= 4.0"]
})]
};
};
\ No newline at end of file
};
......
<template>
<div class="home">
<!-- <div class="title"></div>
<div class="home">
<!-- <div class="title"></div>
<div class="sys-btn btn-margin">我要报名</div>
<div class="rule"></div>
<div class="prize"></div>
......@@ -9,7 +9,7 @@
<div class="leap-03"></div>
<div class="remain"></div>
<bottom-tool v-model="activityIndex"></bottom-tool>-->
</div>
</div>
</template>
<script>
......@@ -40,12 +40,29 @@ export default {
return;
}
// SimonFungC 检测是否跳转中奖表单页
let from = params["f"];
if (from == "award") {
let data = {
route: "/award",
params: {}
};
localStorage.setItem(
"_jiajia_childrenhost_redirect",
JSON.stringify(data)
);
let link = location.origin + location.pathname;
location.href = link;
return;
}
if (store.getSession()) {
this.toNextPath();
} else {
if (params["openId"]) {
this.loginParam.openid = params["openId"];
this.loginParam.accessToken = params["access_token"];
this.loginParam.accessToken = params["access_token"];
console.log("this.loginParam:",this.loginParam)
this.login();
} else {
store.toWxLogin();
......
import api from '../../api/api'
import {
httpGet,
httpPost
} from '../../api/fetch-api.js'
import {
Toast,
Dialog
} from 'vant';
import {
checkMobile
} from "../../utils/utils";
let urls = {
index: "/jiajiaCHApi/app/index"
};
export default {
data() {
return {
key: 'value',
form: {
username: "",
mobile: "",
address: "",
},
userInfo: {},
rank: 0,
}
},
components: {},
computed: {
isAward() {
let rank = this.rank;
return rank > 0 && rank <= 80;
}
},
methods: {
initData() {
let link = location.origin + location.pathname;
link += "?f=award";
as.setShare(link, "", "", "");
this.toSign().then((result) => {
this.getUserInfo();
})
},
getUserInfo() {
return new Promise((resolve, reject) => {
as.queryFunV2('queryUserInfo', {
openid: this.userInfo.openid || ""
}, res => {
if (res && res[0] && res[0][0] && res[0][0].openid) {
// console.log("this.userInfo:",this.userInfo);
this.userInfo.hdp_id = res[0][0].hdp_id;
}
})
})
},
toRule() {
this.$router.push({
path: "/"
})
},
checkSubmit() {
return new Promise((resolve, reject) => {
let {
username,
mobile,
address
} = this.form;
let rank = this.rank;
if (this.isAward) {
Dialog.alert({
message: `您的排行是${rank}名,非获奖用户`
}).then(() => {
// on close
});
reject();
return;
}
if (!username) {
Toast("请填写真实姓名");
reject();
return;
}
if (!mobile) {
Toast("请填写手机号码");
reject();
return;
}
if (!checkMobile(mobile)) {
Toast("请填写有效手机号码");
reject();
return;
}
if (!address) {
Toast("请填写真实收件地址");
reject();
return;
}
resolve();
})
},
onSubmitHandler() {
this.checkSubmit().then((result) => {
Dialog.confirm({
message: '确认提交?'
}).then(() => {
Toast.loading({
mask: true,
message: '加载中...'
});
let data = this.form;
let userInfo = this.userInfo;
data.rank = this.rank;
data.id = userInfo && userInfo.hdp_id || "";
data.openid = userInfo && userInfo.openid || "";
data.avatar = userInfo && userInfo.avatar || "";
data.nickname = userInfo && userInfo.nickname || "";
data.unionid = userInfo && userInfo.unionid || "";
data.userid = userInfo && userInfo.userId || "";
console.log("data:", data);
as.saveTable('user', data, res => {
console.log("saveTable:", res);
Toast.clear();
if (res && res.id) {
if (!this.userInfo.hdp_id) {
this.userInfo.hdp_id = res.id
}
Dialog.alert({
title: '提交成功',
message: '提交成功后,我们将尽快与您联系'
}).then(() => {});
} else {
Toast("网络异常,提交失败");
}
})
}).catch(() => {
// on cancel
});
});
},
toSign() {
return new Promise((resolve, reject) => {
Toast.loading({
mask: true,
message: "请稍等..."
});
httpGet({
url: urls.index
}).then(res => {
Toast.clear();
this.rank = res.rank;
// this.rank = 30;
this.userInfo = res.dto;
this.form.username = this.userInfo && this.userInfo.userName || "";
this.form.mobile = this.userInfo && this.userInfo.mobile || "";
resolve();
});
})
}
},
mounted() {},
created() {
this.initData();
}
}
@import './../../styles/support.scss';
@import './../../styles/utils.scss';
$contentWidth:620px;
.page {
color: #303531;
.main {
.top-space {
height: 120px;
}
.content {
.table {
width: $contentWidth;
// min-height: 800px;
border-radius: 30px;
background-color: #fff;
margin: 0 auto;
padding: 38px 0 48px;
.tit {
text-align: center;
font-size: 40px;
font-weight: 500;
// padding: 38px 0 0;
.t1 {
font-size: 24px;
}
}
.prize {
position: relative;
background-color: #ffdf1a;
width: 210px;
height: 210px;
border-radius: 105px;
margin: 20px auto 0;
@extend .fcc;
text-align: center;
.img {
height: 164px;
}
}
.form {
margin: 36px auto 0;
&-item {
display: flex;
justify-content: space-between;
align-items: center;
@extend .bb;
padding: 0 32px;
font-size: 24px;
margin: 32px 0;
.label {
width: 132px;
}
.label2 {
align-self: flex-start;
}
.ipt {
flex: 1;
height: 52px;
border: 1px solid #82acae;
background-color: #addfe1;
border-radius: 26px;
line-height: 52px;
display: flex;
align-items: center;
@extend .bb;
padding: 0 16px;
}
.textarea {
min-height: 120px;
}
}
.btn-wrap {
margin: 60px auto 0;
position: relative;
z-index: 101;
.tips{
text-align: center;
font-size: 22px;
padding: 12px 0;
color: #333333;
.rule-btn{
color: $colorBlue;
text-decoration: underline;
}
}
.submit-btn {
width: 342px;
height: 110px;
line-height: 100px;
background-image: url("../../assets/imgs/btn2.png");
@extend .bis;
text-align: center;
color: #fff;
font-size: 40px;
font-weight: 600;
margin: 0 auto;
}
.disable {
border-radius: 55px;
line-height: 110px;
background-image: none;
color: #ffffff;
background: #c9c9c9;
}
}
}
}
}
}
.top {
background-image: url('../../assets/imgs/head-leap.png');
@extend .bis;
width: 750px;
height: 231px;
position: absolute;
top: 0;
left: 0;
}
.bottom {
background-image: url('../../assets/imgs/award-c1.png');
@extend .bis;
width: 750px;
height: 565px;
position: fixed;
bottom: 0;
left: 0;
}
}
<template>
<div class="page">
<!-- <div class="app__bgc bgc"></div> -->
<div class="app__bg bg"></div>
<div class="app__content main">
<div class="top"></div>
<div class="top-space"></div>
<div class="content">
<div class="table">
<div class="tit">
<div class="t1">亲爱的{{userInfo.nickname}}</div>
<div class="t2">恭喜获奖</div>
</div>
<div class="prize">
<img class="img" src="../../assets/imgs/award-c2.png">
</div>
<div class="form">
<div class="form-item">
<div class="label">收件人:</div>
<input v-model="form.username" class="ipt" type="text" placeholder="请填写真实姓名">
</div>
<div class="form-item">
<div class="label">联系方式:</div>
<input v-model="form.mobile" class="ipt" type="text" placeholder="请填写手机号码">
</div>
<div class="form-item">
<div class="label label2">收件地址:</div>
<textarea v-model="form.address" class="ipt textarea" placeholder="请填写真实收件地址"></textarea>
</div>
<div class="btn-wrap">
<template v-if="!isAward">
<div class="tips">您的排行是{{rank}}名,非获奖用户,详情见
<span @click="toRule" class="rule-btn">大赛介绍</span>
</div>
<div class="submit-btn disable">确认提交</div>
</template>
<template v-else>
<div @click="onSubmitHandler" class="submit-btn">确认提交</div>
</template>
</div>
</div>
</div>
</div>
<div class="bottom"></div>
</div>
</div>
</template>
<script src="./award.js"></script>
<style lang="scss" scoped>
@import "./award.scss";
</style>
import api from '../../api/api'
import {
httpGet,
httpPost
} from '../../api/fetch-api.js'
export default {
data() {
return {
key: 'value'
}
},
components: {},
methods: {
initData() {}
},
mounted() {},
created() {
console.log("demo created");
}
}
\ No newline at end of file
@import './../../styles/support';
<template>
<div class="page">
<div class="app__bgc bgc"></div>
<div class="app__bg bg"></div>
<div class="app__content main">
<div class="top-space"></div>
<div class="content">
<span class="iconfont iconclose">demo</span>
</div>
</div>
</div>
</template>
<script src="./demo.js"></script>
<style lang="scss" scoped>
@import "./demo.scss";
</style>
......@@ -5,80 +5,88 @@ import Home from './pages/Home.vue'
Vue.use(Router)
const routes = [{
path: '/',
name: 'home',
component: Home,
meta: {
title: '加载中...'
}
},
{
path: '/index',
name: 'index',
component: () => import('./pages/index/index.vue'),
meta: {
title: '大赛介绍'
}
},
{
path: '/sign',
name: 'sign',
component: () => import('./pages/sign/index.vue'),
meta: {
title: '我要报名'
}
},
{
path: '/list',
name: 'list',
component: () => import('./pages/list/index.vue'),
meta: {
title: '人气评选'
}
},
{
path: '/welfare',
name: 'welfare',
component: () => import('./pages/welfare/index.vue'),
meta: {
title: '更多福利'
}
},
{
path: '/draw',
name: 'draw',
component: () => import('./pages/draw/index.vue'),
meta: {
title: '幸运抽奖'
}
},
{
path: '/prize',
name: 'prize',
component: () => import('./pages/prize/index.vue'),
meta: {
title: '我的奖品'
}
}
path: '/',
name: 'home',
component: Home,
meta: {
title: '加载中...'
}
},
{
path: '/index',
name: 'index',
component: () => import('./pages/index/index.vue'),
meta: {
title: '大赛介绍'
}
},
{
path: '/award',
name: 'award',
component: () => import('./pages/award/award.vue'),
meta: {
title: '表单填写'
}
},
{
path: '/sign',
name: 'sign',
component: () => import('./pages/sign/index.vue'),
meta: {
title: '我要报名'
}
},
{
path: '/list',
name: 'list',
component: () => import('./pages/list/index.vue'),
meta: {
title: '人气评选'
}
},
{
path: '/welfare',
name: 'welfare',
component: () => import('./pages/welfare/index.vue'),
meta: {
title: '更多福利'
}
},
{
path: '/draw',
name: 'draw',
component: () => import('./pages/draw/index.vue'),
meta: {
title: '幸运抽奖'
}
},
{
path: '/prize',
name: 'prize',
component: () => import('./pages/prize/index.vue'),
meta: {
title: '我的奖品'
}
}
]
// add route path
routes.forEach(route => {
route.path = route.path || '/' + (route.name || '');
route.path = route.path || '/' + (route.name || '');
});
const router = new Router({
routes
routes
});
router.beforeEach((to, from, next) => {
let link = location.origin + location.pathname;
as.setShare(link, "", "", "");
const title = to.meta && to.meta.title;
if (title) {
document.title = title;
}
next();
let link = location.origin + location.pathname;
as.setShare(link, "", "", "");
const title = to.meta && to.meta.title;
if (title) {
document.title = title;
}
next();
});
export default router;
\ No newline at end of file
export default router;
......
......@@ -203,3 +203,39 @@
}
}
.bis {
background-repeat: no-repeat;
background-size: 100% 100%;
}
//flex 布局和 子元素 对其方式
.fl {
display: flex;
}
.fj {
display: flex;
justify-content: space-between;
}
//水平和垂直居中
.fcc {
display: flex;
justify-content: center;
align-items: center;
}
// 为元素设定的宽度和高度决定了元素的边框盒。
.bb {
box-sizing: border-box;
}
// 满屏
.fullp {
width: 100%;
height: 100%;
}
......
// const merge = require("webpack-merge");
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const Timestamp = new Date().getTime();
// 打包目录
// 打包目录
let webpack_public_path = 'dist'
if (process.env.NODE_ENV === 'production') {
webpack_public_path = process.env.VUE_APP_TITLE
webpack_public_path = process.env.VUE_APP_TITLE
}
const Timestamp = new Date().getTime();
module.exports = {
// 部署生产环境和开发环境下的URL。
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
//例如 https://www.my-app.com/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.my-app.com/my-app/,则设置 baseUrl 为 /my-app/。
//baseUrl 从 Vue CLI 3.3 起已弃用,请使用publicPath
//baseUrl: process.env.NODE_ENV === "production" ? "./" : "/",
configureWebpack: { // webpack 配置
// 修改打包后js文件名
output: { // 输出重构 打包编译后的 文件名称 【模块名称.版本号.时间戳】
filename: `static/js/[name].${Timestamp}.js`,
chunkFilename: `static/js/[name].${Timestamp}.js`
},
// 修改打包后css文件名
plugins: [
new MiniCssExtractPlugin({
filename: `static/css/[name].${Timestamp}.css`,
chunkFilename: `static/css/[name].${Timestamp}.css`
})
]
},
configureWebpack: { // webpack 配置
// 修改打包后js文件名
output: { // 输出重构 打包编译后的 文件名称 【模块名称.版本号.时间戳】
filename: `static/js/[name].${Timestamp}.js`,
chunkFilename: `static/js/[name].${Timestamp}.js`
},
// 修改打包后css文件名
plugins: [
new MiniCssExtractPlugin({
filename: `static/css/[name].${Timestamp}.css`,
chunkFilename: `static/css/[name].${Timestamp}.css`
})
]
},
// 修改打包后img文件名
// chainWebpack: config => {
// config.module
// .rule('images')
// .use('url-loader')
// .tap(options => {
// return {
// limit: 4096,
// fallback: {
// loader: 'file-loader',
// options: {
// name: `img/[name].${Timestamp}.[ext]`
// }
// }
// };
// })
// },
publicPath: process.env.NODE_ENV === "dev" ? "/" : "https://kd.cdn.xyiyang.com/app/f2mb/",
// publicPath: process.env.NODE_ENV === "dev" ? "/" : "./",
// 部署生产环境和开发环境下的URL。
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
//例如 https://www.my-app.com/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.my-app.com/my-app/,则设置 baseUrl 为 /my-app/。
//baseUrl 从 Vue CLI 3.3 起已弃用,请使用publicPath
//baseUrl: process.env.NODE_ENV === "production" ? "./" : "/",
publicPath: process.env.NODE_ENV === "dev" ? "/" : "./",
// outputDir: 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)
outputDir: webpack_public_path,
//用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
assetsDir: "assets",
//指定生成的 index.html 的输出路径 (打包之后,改变系统默认的index.html的文件名)
// indexPath: "myIndex.html",
//默认情况下,生成的静态资源在它们的文件名中包含了 hash 以便更好的控制缓存。你可以通过将这个选项设为 false 来关闭文件名哈希。(false的时候就是让原来的文件名不改变)
filenameHashing: false,
// outputDir: 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)
outputDir: webpack_public_path,
//用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
assetsDir: "static",
//指定生成的 index.html 的输出路径 (打包之后,改变系统默认的index.html的文件名)
// indexPath: "myIndex.html",
//默认情况下,生成的静态资源在它们的文件名中包含了 hash 以便更好的控制缓存。你可以通过将这个选项设为 false 来关闭文件名哈希。(false的时候就是让原来的文件名不改变)
filenameHashing: false,
// lintOnSave:{ type:Boolean default:true } 问你是否使用eslint
lintOnSave: true,
//如果你想要在生产构建时禁用 eslint-loader,你可以用如下配置
// lintOnSave: process.env.NODE_ENV !== 'production',
// lintOnSave:{ type:Boolean default:true } 问你是否使用eslint
lintOnSave: true,
//如果你想要在生产构建时禁用 eslint-loader,你可以用如下配置
// lintOnSave: process.env.NODE_ENV !== 'production',
//是否使用包含运行时编译器的 Vue 构建版本。设置为 true 后你就可以在 Vue 组件中使用 template 选项了,但是这会让你的应用额外增加 10kb 左右。(默认false)
// runtimeCompiler: false,
//是否使用包含运行时编译器的 Vue 构建版本。设置为 true 后你就可以在 Vue 组件中使用 template 选项了,但是这会让你的应用额外增加 10kb 左右。(默认false)
// runtimeCompiler: false,
/**
* 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
* 打包之后发现map文件过大,项目文件体积很大,设置为false就可以不输出map文件
* map文件的作用在于:项目打包后,代码都是经过压缩加密的,如果运行时报错,输出的错误信息无法准确得知是哪里的代码报错。
* 有了map就可以像未加密的代码一样,准确的输出是哪一行哪一列有错。
* */
productionSourceMap: false,
/**
* 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
* 打包之后发现map文件过大,项目文件体积很大,设置为false就可以不输出map文件
* map文件的作用在于:项目打包后,代码都是经过压缩加密的,如果运行时报错,输出的错误信息无法准确得知是哪里的代码报错。
* 有了map就可以像未加密的代码一样,准确的输出是哪一行哪一列有错。
* */
productionSourceMap: false,
// 它支持webPack-dev-server的所有选项
devServer: {
// host: "192.168.0.101",
host: "localhost",
port: 9001, // 端口号
https: false, // https:{type:Boolean}
open: true, //配置自动启动浏览器
// proxy: 'http://localhost:4000' // 配置跨域处理,只有一个代理
}
};
\ No newline at end of file
// 它支持webPack-dev-server的所有选项
devServer: {
// host: "localhost",
port: 9001, // 端口号
https: false, // https:{type:Boolean}
open: true, //配置自动启动浏览器
// proxy: 'http://localhost:4000' // 配置跨域处理,只有一个代理
}
};
......