Skip to content

Commit

Permalink
style: prettier code
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaozhu188 committed Mar 18, 2021
1 parent b1a00d2 commit 4d7e388
Show file tree
Hide file tree
Showing 47 changed files with 149 additions and 179 deletions.
1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
> 1%
last 2 versions
not dead
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
34 changes: 16 additions & 18 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,23 @@ module.exports = {
env: {
node: true,
},
extends: ["plugin:vue/essential", "@vue/standard"],
rules: {
"no-console": "off",
"space-in-parens": "off",
"no-debugger": "off",
"no-mixed-operators": "off",
eqeqeq: "off",
"no-unused-vars": "off",
camelcase: "off",
"arrow-parens": "off",
"generator-star-spacing": "off",
"object-curly-even-spacing": "on",
"one-var": "off",
indent: "off",
"vue/no-unused-components": "off",
"no-unneeded-ternary": "off",
semicolon: "on",
},
extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"],
parserOptions: {
parser: "babel-eslint",
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
},
overrides: [
{
files: [
"**/__tests__/*.{j,t}s?(x)",
"**/tests/unit/**/*.spec.{j,t}s?(x)",
],
env: {
jest: true,
},
},
],
};
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
node_modules
/dist

/tests/e2e/videos/
/tests/e2e/screenshots/


# local env files
.env.local
.env.*.local
Expand All @@ -10,6 +14,7 @@ node_modules
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
Expand All @@ -21,4 +26,4 @@ yarn-error.log*
*.sw?

#Electron-builder output
/dist_electron
/dist_electron
37 changes: 0 additions & 37 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ coverage
dist
docs
node_modules
tests
.idea
.github
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"arrowParens": "always",
"endOfLine": "lf",
"bracketSpacing": true,
"proseWrap": "preserve",
"htmlWhitespaceSensitivity": "strict"
}
Empty file added docs/.nojekyll
Empty file.
4 changes: 4 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# electron-vue-cloud-music

> Electron+Vue+Ant Design Vue仿网易云音乐windows客户端实战项目
8 changes: 8 additions & 0 deletions docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
![logo](images/logo.png)

# electron仿网易云音乐
> Electron+Vue+Ant Design Vue仿网易云音乐windows客户端实战项目

[GitHub](https://github.com/xiaozhu188/electron-vue-cloud-music)
[Get Started](#electron-vue-cloud-music)
1 change: 1 addition & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [首页](#electron-vue-cloud-music)
Binary file added docs/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>electron-vue-cloud-music - electron网易云音乐</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="electron网易云音乐">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
<style>
img[alt="logo"] {
width: 100px;
}
</style>
</head>
<body>
<div id="app"></div>
<script>
window.$docsify = {
name: 'electron-vue-cloud-music',
loadSidebar: true,
coverpage: true,
repo: ''
}
</script>
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
</body>
</html>
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"major": "npm version major && git push origin master && git push origin --tags",
"release": "vue-cli-service electron:build --publish always",
"lint": "vue-cli-service lint",
"prettier": "npx prettier --write ./src ./test"
"prettier": "npx prettier --write ./src ./test",
"doc": "docsify serve docs"
},
"appId": "com.xiaozhu.cloudmusic",
"main": "background.js",
Expand Down
10 changes: 4 additions & 6 deletions src/main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async function createWindow() {
frame: process.platform !== "win32",
show: true,
backgroundColor: "#2e2c29",
hasShadow: process.platform === "darwin" ? false : true,
hasShadow: process.platform !== "darwin",
webPreferences: {
webSecurity: false,
nodeIntegration: true,
Expand All @@ -114,11 +114,9 @@ async function createWindow() {
// 去除原生顶部菜单栏
mainWindow.setMenu(null);
// 如果是windows系统模拟托盘菜单
if (process.platform === "win32") {
global.tray = createTray(Tray);
let trayBounds = global.tray.getBounds();
global.trayWindow = createTrayWindow(BrowserWindow, trayBounds);
}
global.tray = createTray(Tray);
let trayBounds = global.tray.getBounds();
global.trayWindow = createTrayWindow(BrowserWindow, trayBounds);
}

if (process.env.WEBPACK_DEV_SERVER_URL) {
Expand Down
14 changes: 5 additions & 9 deletions src/main/modules/ipcEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ipcMain, dialog, app, BrowserWindow, shell } from "electron";
import path from "path";
import createMiniWindow from "../windows/miniWindow";
import createUpdateWindow from "./../windows/updateWindow";
import { defaultDownloadFolder } from "../../renderer/config/downloadSettings";
let { download } = require("electron-dl");
let downloads = {};
let updateWindow;
Expand Down Expand Up @@ -138,21 +137,18 @@ export default function () {
}
});

ipcMain.on("open-directory-dialog", (event) => {
dialog.showOpenDialog(
ipcMain.on("open-directory-dialog", async (event) => {
let res = await dialog.showOpenDialog(
{
defaultPath: defaultDownloadFolder,
properties: ["openDirectory", "multiSelections"],
// filters: [
// { name: 'Audio', extensions: ['mp3', 'wma'] }
// ]
},
function (files) {
if (files) {
event.sender.send("selectedItem", files);
}
}
);
if (res.filePaths) {
event.sender.send("selectedItem", res.filePaths);
}
});

ipcMain.on("ondragstart", (event, e) => {
Expand Down
1 change: 1 addition & 0 deletions src/main/windows/miniWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const createMiniWindow = function (BrowserWindow) {
closable: false,
resizable: process.env.NODE_ENV === "development",
// transparent: process.platform !== "linux",
hasShadow: process.platform !== "darwin",
alwaysOnTop: true,
webPreferences: {
webSecurity: false,
Expand Down
1 change: 0 additions & 1 deletion src/renderer/components/BasicHeader/FrameActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export default {
case "mini":
this.$electron.ipcRenderer.send("toggle-mini", {
value: true,
storeState: this.$store.state,
});
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/BasicHeader/SeachBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
import { getSearchHot, getSearchSuggest } from "@/api/search";
import { debounce } from "@/utils/dom";
import { normalSong } from "@/utils/song";
import { mapGetters } from "vuex";
import { mapGetters, mapState } from "vuex";
import playMixin from "@/mixins/Play.js";
export default {
Expand All @@ -92,7 +92,7 @@ export default {
};
},
computed: {
...mapGetters("Search", ["searchHistory"]),
...mapState("Search", ["searchHistory"]),
...mapGetters("play", ["current_song"]),
overlayStyle() {
return this.keyword && this.suggests
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/BasicHeader/ThemeSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</template>

<script>
import { mapGetters } from "vuex";
import { mapState } from "vuex";
import ZIcon from "@/components/ZIcon";
import { colorList } from "@/config/config";
import config from "@/config/defaultSettings";
Expand All @@ -50,7 +50,7 @@ export default {
ZIcon,
},
computed: {
...mapGetters("App", ["primaryColor"]),
...mapState("App", ["primaryColor"]),
},
created() {
console.log("__dirname", __dirname);
Expand Down
3 changes: 1 addition & 2 deletions src/renderer/components/BasicHeader/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ export default {
FrameActions,
},
computed: {
...mapState("App", ["platform"]),
...mapGetters("App", ["primaryColor"]),
...mapState("App", ["platform", "primaryColor"]),
...mapGetters("User", ["userId"]),
...mapGetters("play", [
"current_song",
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/BasicSider/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default {
watch: {
userId(newVal) {
if (newVal !== "") {
if (this.$store.state.App.isOnliline) {
if (this.$store.state.App.isOnline) {
this._getUserPlaylist(newVal);
this.$store.dispatch("User/getUserLikedSongs");
}
Expand All @@ -98,7 +98,7 @@ export default {
},
},
created() {
if (this.userId && this.$store.state.App.isOnliline) {
if (this.userId && this.$store.state.App.isOnline) {
this._getUserPlaylist(this.userId);
}
},
Expand Down
Loading

0 comments on commit 4d7e388

Please sign in to comment.