Commit 744eea64 authored by ljd's avatar ljd

初始化代码

parent b99bf594
...@@ -3,3 +3,9 @@ indent_style = space ...@@ -3,3 +3,9 @@ indent_style = space
indent_size = 4 indent_size = 4
trim_trailing_whitespace = true trim_trailing_whitespace = true
insert_final_newline = true insert_final_newline = true
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
This diff is collapsed.
module.exports = { module.exports = {
presets: [ presets: [
'@vue/cli-plugin-babel/preset', '@vue/cli-plugin-babel/preset'
// '@vue/app', // '@vue/app',
// ['es2015', { 'modules': false }] // ['es2015', { 'modules': false }]
], ],
plugins: [["component", plugins: [['component',
{ {
"libraryName": "mint-ui", libraryName: 'mint-ui',
"style": true style: true
} }
]] ]]
} }
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "~4.3.0", "@vue/cli-plugin-babel": "~4.3.0",
"@vue/cli-plugin-eslint": "~4.3.0", "@vue/cli-plugin-eslint": "^4.3.1",
"@vue/cli-plugin-pwa": "~4.3.0", "@vue/cli-plugin-pwa": "~4.3.0",
"@vue/cli-plugin-router": "~4.3.0", "@vue/cli-plugin-router": "~4.3.0",
"@vue/cli-plugin-vuex": "~4.3.0", "@vue/cli-plugin-vuex": "~4.3.0",
......
...@@ -4,12 +4,12 @@ import Vuex from 'vuex' ...@@ -4,12 +4,12 @@ import Vuex from 'vuex'
Vue.use(Vuex) Vue.use(Vuex)
export default new Vuex.Store({ export default new Vuex.Store({
state: { state: {
}, },
mutations: { mutations: {
}, },
actions: { actions: {
}, },
modules: { modules: {
} }
}) })
<template> <template>
<div class="home"> <div class="home">
<img alt="Vue logo" src="../assets/logo.png"> <img alt="Vue logo" src="../assets/logo.png" />
<HelloWorld msg="Welcome to Your Vue.js App" /> <HelloWorld msg="Welcome to Your Vue.js App" />
</div> </div>
</template> </template>
......
...@@ -15,5 +15,4 @@ export default { ...@@ -15,5 +15,4 @@ export default {
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
</style> </style>
<template> <template>
<div class="page flex flex-column flex-xc"> <div class="page flex flex-column flex-xc">
<div class="cnt"> <div class="cnt">
<img src="../../assets/img/app404.png"> <img src="../../assets/img/app404.png" />
<p>您访问的页面不存在或链接错误</p> <p>您访问的页面不存在或链接错误</p>
<!-- <a href="/" class="back-home">回首页</a> --> <!-- <a href="/" class="back-home">回首页</a> -->
</div> </div>
...@@ -15,35 +15,35 @@ export default { ...@@ -15,35 +15,35 @@ export default {
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
@import '../../assets/css/func.less'; @import "../../assets/css/func.less";
.page { .page {
width: 100%; width: 100%;
height: 100%; height: 100%;
text-align: center; text-align: center;
background-color: #fff; background-color: #fff;
} }
.cnt { .cnt {
align-items: center; align-items: center;
} }
.cnt img { .cnt img {
width: px2rem(370); width: px2rem(370);
} }
.cnt p { .cnt p {
font-size: px2rem(30); font-size: px2rem(30);
color: #999; color: #999;
margin-top: px2rem(30); margin-top: px2rem(30);
} }
.cnt a.back-home { .cnt a.back-home {
display: inline-block; display: inline-block;
height: px2rem(66); height: px2rem(66);
line-height: px2rem(66); line-height: px2rem(66);
padding: 0 px2rem(60); padding: 0 px2rem(60);
font-size: px2rem(30); font-size: px2rem(30);
background-color: #3b81ff; background-color: #3b81ff;
color: #fff; color: #fff;
border-radius: px2rem(60); border-radius: px2rem(60);
margin-top: px2rem(80); margin-top: px2rem(80);
margin-bottom: px2rem(180); margin-bottom: px2rem(180);
box-shadow: 0 px2rem(8) px2rem(40) 0 rgba(59,129,255,.3); box-shadow: 0 px2rem(8) px2rem(40) 0 rgba(59, 129, 255, 0.3);
} }
</style> </style>
<template> <template>
<div class="about"> <div class="about">
<h1>This is an about page</h1> <h1>This is an about page</h1>
</div> </div>
</template> </template>
This diff is collapsed.
...@@ -17,13 +17,9 @@ export default { ...@@ -17,13 +17,9 @@ export default {
'mt-button': Button 'mt-button': Button
}, },
data() { data() {
return { return {}
}
}, },
mounted() {}, mounted() {},
methods: { methods: {}
}
} }
</script> </script>
const path = require('path');//引入path模块 const path = require('path')// 引入path模块
function resolve(dir){ function resolve(dir) {
return path.join(__dirname,dir)//path.join(__dirname)设置绝对路径 return path.join(__dirname, dir)// path.join(__dirname)设置绝对路径
} }
module.exports = { module.exports = {
devServer: { devServer: {
...@@ -10,23 +10,21 @@ module.exports = { ...@@ -10,23 +10,21 @@ module.exports = {
}, },
proxy: 'http://localhost:8080' proxy: 'http://localhost:8080'
}, },
lintOnSave: process.env.NODE_ENV !== 'production', // lintOnSave: process.env.NODE_ENV !== 'production',
lintOnSave: true,
chainWebpack:(config)=>{ chainWebpack: (config) => {
// 设置别名 // 设置别名
config.resolve.alias config.resolve.alias
.set('@',resolve('./src')) .set('@', resolve('./src'))
.set('components',resolve('./src/components')) .set('components', resolve('./src/components'))
//set第一个参数:设置的别名,第二个参数:设置的路径
},
chainWebpack: config => {
config.module config.module
.rule('eslint') .rule('eslint')
.use('eslint-loader') .use('eslint-loader')
.loader('eslint-loader') .loader('eslint-loader')
.tap(options => { .tap(options => {
options.fix = true options.fix = true
return options return options
}) })
// set第一个参数:设置的别名,第二个参数:设置的路径
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment