forked from xinghaix/download-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
luxin
committed
Dec 9, 2019
1 parent
8ab1c92
commit 01be590
Showing
6 changed files
with
139 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,41 @@ | ||
<template> | ||
<h1>options (developing...)</h1> | ||
<div> | ||
<div class="header"> | ||
<img :src="`${publicPath}img/icon38.png`" alt=""/> | ||
<a>下载管理器</a> | ||
</div> | ||
<div class="content"> | ||
|
||
</div> | ||
</div> | ||
</template> | ||
|
||
<!--suppress JSUnresolvedVariable, UnterminatedStatementJS --> | ||
<script> | ||
export default { | ||
name: 'Options' | ||
/* eslint-disable no-undef */ | ||
export default { | ||
name: 'Options', | ||
data() { | ||
return { | ||
publicPath: process.env.BASE_URL, | ||
} | ||
}, | ||
methods: { | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
<style scoped rel="stylesheet/css"> | ||
.header { | ||
display: inline-block; | ||
height: 38px; | ||
} | ||
.header a { | ||
line-height: 38px; | ||
font-size: 22px; | ||
} | ||
.content { | ||
height: calc(100vh - 38px); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import Vue from 'vue' | ||
import Vuex from 'vuex' | ||
import * as types from '../store/types' | ||
|
||
Vue.use(Vuex); | ||
|
||
const Store = new Vuex.Store({ | ||
state: { | ||
title: '', | ||
accept_danger: true, | ||
}, | ||
mutations: { | ||
[types.LOGIN]: (state, data) => { | ||
localStorage.token = data.token; | ||
state.token = data.token; | ||
this.state.username = data.username; | ||
state.role = data.role; | ||
}, | ||
[types.LOGOUT]: (state) => { | ||
localStorage.removeItem('token'); | ||
state.token = null; | ||
state.username = null; | ||
state.role = null; | ||
}, | ||
[types.TITLE]: (state, title) => { | ||
state.title = title; | ||
} | ||
} | ||
}); | ||
|
||
export default Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const LOGIN = 'login'; | ||
export const LOGOUT = 'logout'; | ||
export const TITLE = 'title'; |