Skip to content

Commit

Permalink
feat: 测试husky
Browse files Browse the repository at this point in the history
  • Loading branch information
Cosen95 committed Aug 22, 2021
1 parent 952c4e7 commit 488a6c2
Show file tree
Hide file tree
Showing 32 changed files with 249 additions and 151 deletions.
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
extends: ["@commitlint/config-conventional"]
}
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"name": "ts-vue",
"version": "0.1.0",
"private": true,
"author": "cosen95",
"author": "Cosen95",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"lint": "vue-cli-service lint --fix",
"svg": "vsvg -s ./src/icons/svg -t ./src/icons/components --ext ts --es6",
"test:unit": "vue-cli-service test:unit",
"prepare": "husky install"
Expand Down
1 change: 0 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<template>
<div id="app">
<router-view />
Expand Down
9 changes: 6 additions & 3 deletions src/components/Breadcrumb/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
<transition-group name="breadcrumb">
<el-breadcrumb-item v-for="(item, index) in breadcrumbs" :key="item.path">
<span
v-if="item.redirect === 'noredirect' || index === breadcrumbs.length-1"
v-if="
item.redirect === 'noredirect' || index === breadcrumbs.length - 1
"
class="no-redirect"
>{{ item.meta.title }}</span>
>{{ item.meta.title }}</span
>
<a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
</el-breadcrumb-item>
</transition-group>
Expand Down Expand Up @@ -86,4 +89,4 @@ export default class extends Vue {
cursor: text;
}
}
</style>
</style>
4 changes: 2 additions & 2 deletions src/components/Hamburger/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div :class="[{'is-active': isActive}]" @click="toggleClick">
<div :class="[{ 'is-active': isActive }]" @click="toggleClick">
<svg-icon name="hamburger" width="20" height="20" />
</div>
</template>
Expand All @@ -24,4 +24,4 @@ export default class extends Vue {
.is-active {
transform: rotate(180deg);
}
</style>
</style>
4 changes: 2 additions & 2 deletions src/components/Pagination/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div :class="{'hidden': hidden}" class="pagination-container">
<div :class="{ hidden: hidden }" class="pagination-container">
<el-pagination
:background="background"
:current-page.sync="currentPage"
Expand Down Expand Up @@ -72,4 +72,4 @@ export default class extends Vue {
.pagination-container.hidden {
display: none;
}
</style>
</style>
8 changes: 4 additions & 4 deletions src/components/RightPanel/index.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template>
<div ref="rightPanel" :class="{show: show}" class="rightPanel-container">
<div ref="rightPanel" :class="{ show: show }" class="rightPanel-container">
<div class="rightPanel-background" />
<div class="rightPanel">
<div
class="handle-button"
:style="{'top': buttonTop+'px','background-color': theme}"
@click="show=!show"
:style="{ top: buttonTop + 'px', 'background-color': theme }"
@click="show = !show"
>
<i :class="show?'el-icon-close':'el-icon-setting'" />
<i :class="show ? 'el-icon-close' : 'el-icon-setting'" />
</div>
<div class="rightPanel-items">
<slot />
Expand Down
11 changes: 10 additions & 1 deletion src/components/ThemePicker/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
<template>
<el-color-picker
v-model="theme"
:predefine="['#409EFF', '#1890ff', '#304156','#212121','#11a983', '#13c2c2', '#6959CD', '#f5222d']"
:predefine="[
'#409EFF',
'#1890ff',
'#304156',
'#212121',
'#11a983',
'#13c2c2',
'#6959CD',
'#f5222d'
]"
class="theme-picker"
popper-class="theme-picker-dropdown"
/>
Expand Down
40 changes: 20 additions & 20 deletions src/icons/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/* tslint:disable */
import './chart'
import './dashboard'
import './edit'
import './example'
import './exit-fullscreen'
import './eye-off'
import './eye-on'
import './form'
import './fullscreen'
import './guide'
import './hamburger'
import './link'
import './list'
import './lock'
import './nested'
import './password'
import './setting'
import './table'
import './tree'
import './user'
import "./chart";
import "./dashboard";
import "./edit";
import "./example";
import "./exit-fullscreen";
import "./eye-off";
import "./eye-on";
import "./form";
import "./fullscreen";
import "./guide";
import "./hamburger";
import "./link";
import "./list";
import "./lock";
import "./nested";
import "./password";
import "./setting";
import "./table";
import "./tree";
import "./user";
2 changes: 1 addition & 1 deletion src/layout/components/AppMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export default class extends Vue {}
.app-main {
overflow: hidden;
}
</style>
</style>
4 changes: 2 additions & 2 deletions src/layout/components/Navbar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ import Screenfull from "@/components/Screenfull/index.vue";
components: {
Breadcrumb,
Hamburger,
Screenfull,
},
Screenfull
}
})
export default class extends Vue {
get sidebar() {
Expand Down
2 changes: 1 addition & 1 deletion src/layout/components/Settings/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ export default class extends Vue {
float: right;
}
}
</style>
</style>
34 changes: 24 additions & 10 deletions src/layout/components/Sidebar/SidebarItem.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,39 @@
<template>
<div
v-if="!item.meta || !item.meta.hidden"
:class="['menu-wrapper', isCollapse ? 'simple-mode' : 'full-mode', {'first-level': isFirstLevel}]"
:class="[
'menu-wrapper',
isCollapse ? 'simple-mode' : 'full-mode',
{ 'first-level': isFirstLevel }
]"
>
<template v-if="!alwaysShowRootMenu && theOnlyOneChild && !theOnlyOneChild.children">
<sidebar-item-link v-if="theOnlyOneChild.meta" :to="resolvePath(theOnlyOneChild.path)">
<template
v-if="!alwaysShowRootMenu && theOnlyOneChild && !theOnlyOneChild.children"
>
<sidebar-item-link
v-if="theOnlyOneChild.meta"
:to="resolvePath(theOnlyOneChild.path)"
>
<el-menu-item
:index="resolvePath(theOnlyOneChild.path)"
:class="{'submenu-title-noDropdown': isFirstLevel}"
:class="{ 'submenu-title-noDropdown': isFirstLevel }"
>
<svg-icon v-if="theOnlyOneChild.meta.icon" :name="theOnlyOneChild.meta.icon" />
<span v-if="theOnlyOneChild.meta.title" slot="title">{{ theOnlyOneChild.meta.title }}</span>
<svg-icon
v-if="theOnlyOneChild.meta.icon"
:name="theOnlyOneChild.meta.icon"
/>
<span v-if="theOnlyOneChild.meta.title" slot="title">{{
theOnlyOneChild.meta.title
}}</span>
</el-menu-item>
</sidebar-item-link>
</template>
<el-submenu v-else :index="resolvePath(item.path)" popper-append-to-body>
<template slot="title">
<svg-icon v-if="item.meta && item.meta.icon" :name="item.meta.icon" />
<span v-if="item.meta && item.meta.title" slot="title">{{ item.meta.title }}</span>
<span v-if="item.meta && item.meta.title" slot="title">{{
item.meta.title
}}</span>
</template>
<template v-if="item.children">
<sidebar-item
Expand Down Expand Up @@ -164,7 +180,7 @@ export default class extends Vue {
}
}
}
</style>
</style>

<style lang="scss" scoped>
.svg-icon {
Expand All @@ -177,5 +193,3 @@ export default class extends Vue {
}
}
</style>


2 changes: 1 addition & 1 deletion src/layout/components/Sidebar/SidebarItemLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ export default class extends Vue {
private isExternal = isExternal;
}
</script>
</script>
2 changes: 1 addition & 1 deletion src/layout/components/Sidebar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ export default class extends Vue {
height: 100%;
width: 100% !important;
}
</style>
</style>
8 changes: 6 additions & 2 deletions src/layout/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<template>
<div :class="classObj" class="app-wrapper">
<div v-if="classObj.mobile && sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
<div
v-if="classObj.mobile && sidebar.opened"
class="drawer-bg"
@click="handleClickOutside"
/>
<sidebar class="sidebar-container" />
<div class="main-container">
<navbar />
Expand Down Expand Up @@ -119,4 +123,4 @@ export default class extends mixins(ResizeMixin) {
transition: none;
}
}
</style>
</style>
8 changes: 4 additions & 4 deletions src/store/modules/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
Module,
Action,
Mutation,
getModule,
getModule
} from "vuex-module-decorators";
import { login, logout, getUserInfo } from "@/api/users";
import { getToken, setToken, removeToken } from "@/utils/cookies";
Expand Down Expand Up @@ -78,7 +78,7 @@ class User extends VuexModule implements IUserState {
// 业务调用方可自行添加业务逻辑
// let { data } = await login({ username, password });
let data = {
accessToken: "abc",
accessToken: "abc"
};
setToken(data.accessToken);
this.SET_TOKEN(data.accessToken);
Expand Down Expand Up @@ -107,8 +107,8 @@ class User extends VuexModule implements IUserState {
roles: ["admin", "editor"],
name: "cosen",
avatar: "",
introduction: "",
},
introduction: ""
}
};
console.log("用户信息", data);
if (!data) {
Expand Down
36 changes: 27 additions & 9 deletions src/views/404.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,26 @@
<div class="wscn-http404-container">
<div class="wscn-http404">
<div class="pic-404">
<img class="pic-404__parent" src="@/assets/404-images/404.png" alt="404" />
<img class="pic-404__child left" src="@/assets/404-images/404-cloud.png" alt="404" />
<img class="pic-404__child mid" src="@/assets/404-images/404-cloud.png" alt="404" />
<img class="pic-404__child right" src="@/assets/404-images/404-cloud.png" alt="404" />
<img
class="pic-404__parent"
src="@/assets/404-images/404.png"
alt="404"
/>
<img
class="pic-404__child left"
src="@/assets/404-images/404-cloud.png"
alt="404"
/>
<img
class="pic-404__child mid"
src="@/assets/404-images/404-cloud.png"
alt="404"
/>
<img
class="pic-404__child right"
src="@/assets/404-images/404-cloud.png"
alt="404"
/>
</div>
<div class="text-404">
<div class="text-404__oops">OOPS!</div>
Expand All @@ -15,12 +31,14 @@
style="color:#20a0ff"
href="https://wallstreetcn.com"
target="_blank"
>wallstreetcn</a>
>wallstreetcn</a
>
</div>
<div class="text-404__headline">{{ message }}</div>
<div
class="text-404__info"
>Please check that the URL you entered is correct, or click the button below to return to the homepage.</div>
<div class="text-404__info">
Please check that the URL you entered is correct, or click the button
below to return to the homepage.
</div>
<a href class="text-404__return-home">Back to home</a>
</div>
</div>
Expand Down Expand Up @@ -230,4 +248,4 @@ export default class extends Vue {
}
}
}
</style>
</style>
2 changes: 1 addition & 1 deletion src/views/charts/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ import { Component, Vue } from "vue-property-decorator";
name: "Account"
})
export default class extends Vue {}
</script>
</script>
4 changes: 2 additions & 2 deletions src/views/dashboard/admin/components/BarChart.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div :class="className" :style="{height: height, width: width}" />
<div :class="className" :style="{ height: height, width: width }" />
</template>

<script lang="ts">
Expand Down Expand Up @@ -94,4 +94,4 @@ export default class extends mixins(ResizeMixin) {
} as EChartOption<EChartOption.SeriesBar>);
}
}
</script>
</script>
5 changes: 2 additions & 3 deletions src/views/dashboard/admin/components/LineChart.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div :class="className" :style="{height: height, width: width}"></div>
<div :class="className" :style="{ height: height, width: width }"></div>
</template>

<script lang="ts">
Expand Down Expand Up @@ -119,5 +119,4 @@ export default class extends mixins(ResizeMixin) {
}
</script>

<style lang="" scoped>
</style>
<style lang="" scoped></style>
Loading

0 comments on commit 488a6c2

Please sign in to comment.