adjust basic configuration

This commit is contained in:
zemal 2017-04-26 16:37:01 +08:00
parent f25f5e94f7
commit 1cbe888a7f
5 changed files with 23 additions and 28 deletions

View File

@ -18,8 +18,8 @@ module.exports = {
'generator-star-spacing': 0,
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
"space-before-function-paren": ["error", {
"anonymous": "always",
"space-before-function-paren": ["warn", {
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}],

View File

@ -289,7 +289,7 @@ export default {
*/
function ajax(url, type, options) {
return new Promise(function(resolve, reject) {
return new Promise(function (resolve, reject) {
options = options || {}
if (options.body === undefined) {
options.body = options.options

View File

@ -1,21 +1,21 @@
<template>
<el-menu theme="dark" :default-active="activeIndex" class="el-menu-demo" mode="horizontal">
<el-row :gutter="10">
<el-col :xs="3" :sm="3" :lg="3">&nbsp;</el-col>
<el-col :xs="2" :sm="2" :lg="2">
<div style="color:#bfcbd9;margin-top:16px;font-size:20px;">QDUOJ</div>
</el-col>
<el-col :xs="16" :sm="16" :lg="16">
<el-menu-item index="1">题目</el-menu-item>
<el-menu-item index="2">提交</el-menu-item>
<el-menu-item index="3">比赛</el-menu-item>
<el-menu-item index="4">排名</el-menu-item>
<el-menu-item index="5">帮助</el-menu-item>
</el-col>
<el-col :xs="3" :sm="3" :lg="3">
<el-submenu index="2">
<template slot="title">Hieda no Chiaki
</template>
<el-menu theme="dark" class="el-menu-demo" mode="horizontal" router>
<el-row :gutter="10">
<el-col :xs="3" :sm="3" :lg="3">&nbsp;</el-col>
<el-col :xs="2" :sm="2" :lg="2">
<div style="color:#bfcbd9;margin-top:16px;font-size:20px;">QDUOJ</div>
</el-col>
<el-col :xs="16" :sm="16" :lg="16">
<el-menu-item index="/problems">题目</el-menu-item>
<el-menu-item index="2">提交</el-menu-item>
<el-menu-item index="3">比赛</el-menu-item>
<el-menu-item index="4">排名</el-menu-item>
<el-menu-item index="5">帮助</el-menu-item>
</el-col>
<el-col :xs="3" :sm="3" :lg="3">
<el-submenu index="2">
<template slot="title">Hieda no Chiaki
</template>
<el-menu-item index="2-1">我的主页</el-menu-item>
<el-menu-item index="2-2">我的提交</el-menu-item>
<el-menu-item index="2-3">设置</el-menu-item>
@ -29,10 +29,5 @@
<script>
export default {
data () {
return {
activeIndex: '1'
}
}
}
</script>

View File

@ -1,11 +1,11 @@
import moment from 'moment'
// 友好显示时间
export function fromNow (time) {
export function fromNow(time) {
return moment(time * 3).fromNow()
}
// 只显示日期
export function onlyDate (time) {
export function onlyDate(time) {
const d = new Date(time * 1000)
return d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate()
}

View File

@ -1,5 +1,5 @@
import moment from 'moment'
export function backendDatetimeToISOFormat (dt) {
export function backendDatetimeToISOFormat(dt) {
return moment(dt, 'YYYY-M-DD HH:mm:ss zz').format()
}