Skip to content

Commit

Permalink
Init project
Browse files Browse the repository at this point in the history
  • Loading branch information
CareyWang committed Jan 31, 2020
1 parent 3755181 commit b3c30e6
Show file tree
Hide file tree
Showing 24 changed files with 9,600 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
> 1%
last 2 versions
18 changes: 18 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/essential',
'eslint:recommended'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'semi': 0
},
parserOptions: {
parser: 'babel-eslint'
}
}
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.DS_Store
node_modules
/dist

# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# sub-web

## Project setup
```
yarn install
```

### Compiles and hot-reloads for development
```
yarn serve
```

### Compiles and minifies for production
```
yarn build
```

### Lints and fixes files
```
yarn lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
14 changes: 14 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
],
plugins: [
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}
]
]
}
35 changes: 35 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "sub-web",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"atob": "^2.1.2",
"axios": "^0.19.1",
"btoa": "^1.2.1",
"core-js": "^3.4.4",
"element-ui": "^2.13.0",
"vue": "^2.6.10",
"vue-clipboard2": "^0.3.1",
"vue-router": "^3.1.3"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",
"@vue/cli-plugin-eslint": "^4.1.0",
"@vue/cli-plugin-router": "^4.1.0",
"@vue/cli-service": "^4.1.0",
"babel-eslint": "^10.0.3",
"babel-plugin-component": "^1.1.1",
"babel-plugin-import": "^1.13.0",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"node-sass": "^4.13.0",
"sass-loader": "^8.0.0",
"vue-particles": "^1.0.9",
"vue-template-compiler": "^2.6.10"
}
}
2 changes: 2 additions & 0 deletions public/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# 单页应用的 Netlify 设置
/* /index.html 200
Binary file added public/favicon.ico
Binary file not shown.
17 changes: 17 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>sub-web</title>
</head>
<body>
<noscript>
<strong>We're sorry but sub-web doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
5 changes: 5 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<div id="app">
<router-view/>
</div>
</template>
79 changes: 79 additions & 0 deletions src/assets/css/element-ui.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// cover some element-ui styles

.el-breadcrumb__inner,
.el-breadcrumb__inner a {
font-weight: 400 !important;
}

.el-upload {
input[type="file"] {
display: none !important;
}
}

.el-upload__input {
display: none;
}

.cell {
.el-tag {
margin-right: 0px;
}
}

.small-padding {
.cell {
padding-left: 5px;
padding-right: 5px;
}
}

.fixed-width {
.el-button--mini {
padding: 7px 10px;
width: 60px;
}
}

.status-col {
.cell {
padding: 0 10px;
text-align: center;

.el-tag {
margin-right: 0px;
}
}
}

// to fixed https://github.com/ElemeFE/element/issues/2461
.el-dialog {
transform: none;
left: 0;
position: relative;
margin: 0 auto;
}

// refine element ui upload
.upload-container {
.el-upload {
width: 100%;

.el-upload-dragger {
width: 100%;
height: 200px;
}
}
}

// dropdown
.el-dropdown-menu {
a {
display: block
}
}

// fix date-picker ui bug in filter-item
.el-range-editor.el-input__inner {
display: inline-flex !important;
}
31 changes: 31 additions & 0 deletions src/assets/css/element-variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* I think element-ui's default theme color is too light for long-term use.
* So I modified the default color and you can modify it to your liking.
**/

/* theme color */
$--color-primary: #304156;
$--color-success: #65C934;
$--color-warning: #E6A23C;
$--color-danger: #F56C6C;
// $--color-info: #1E1E1E;

$--button-font-weight: 400;

// $--color-text-regular: #1f2d3d;

$--border-color-light: #dfe4ed;
$--border-color-lighter: #e6ebf5;

$--table-border:1px solid#dfe6ec;

/* icon font path, required */
$--font-path: '~element-ui/lib/theme-chalk/fonts';

@import "~element-ui/packages/theme-chalk/src/index";

// the :export directive is the magic sauce for webpack
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
:export {
theme: $--color-primary;
}
Binary file added src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions src/components/HelloWorld.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br>
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router" target="_blank" rel="noopener">router</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
</ul>
<h3>Essential Links</h3>
<ul>
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
</ul>
</div>
</template>

<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
15 changes: 15 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Vue from 'vue'
import App from './App.vue'
import router from './router'
require(`@/plugins/element-ui`)
require(`@/plugins/clipboard`)
require(`@/plugins/base64`)
require(`@/plugins/particles`)
require(`@/plugins/axios`)

Vue.config.productionTip = false

new Vue({
router,
render: h => h(App)
}).$mount('#app')
6 changes: 6 additions & 0 deletions src/plugins/axios.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Vue from 'vue'
import axios from "axios"

axios.defaults.timeout = 5000 //请求超时的时间设定

Vue.prototype.$axios = axios
6 changes: 6 additions & 0 deletions src/plugins/base64.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Vue from 'vue'
import btoa from 'btoa'
import atob from 'atob'

Vue.prototype.$btoa = (string) => btoa(string)
Vue.prototype.$atob = (string) => atob(string)
4 changes: 4 additions & 0 deletions src/plugins/clipboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Vue from 'vue'
import clipboard from 'vue-clipboard2'

Vue.use(clipboard)
20 changes: 20 additions & 0 deletions src/plugins/element-ui.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Vue from 'vue'
import Element from 'element-ui'
import locale from 'element-ui/lib/locale/lang/zh-CN'
// import '@/assets/css/element-ui.scss'
// import '@/assets/css/element-element-variables.scss'

Vue.use(Element, {
locale,
size: 'small'
})

Vue.use(Element.Loading.directive);

Vue.prototype.$loading = Element.Loading.service;
Vue.prototype.$msgbox = Element.MessageBox;
Vue.prototype.$alert = Element.MessageBox.alert;
Vue.prototype.$confirm = Element.MessageBox.confirm;
Vue.prototype.$prompt = Element.MessageBox.prompt;
Vue.prototype.$notify = Element.Notification;
Vue.prototype.$message = Element.Message;
4 changes: 4 additions & 0 deletions src/plugins/particles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Vue from 'vue'
import VueParticles from 'vue-particles'

Vue.use(VueParticles)
Loading

0 comments on commit b3c30e6

Please sign in to comment.