@ -1,4 +1,4 @@
|
||||
# 如果发现 npm / yarn 安装太慢,可以解除注释
|
||||
registry=https://registry.npm.taobao.org/
|
||||
ELECTRON_MIRROR=https://npm.taobao.org/mirrors/electron
|
||||
phantomjs_cdnurl=https://npm.taobao.org/dist/phantomjs
|
||||
# registry=https://registry.npm.taobao.org/
|
||||
# ELECTRON_MIRROR=https://npm.taobao.org/mirrors/electron
|
||||
# phantomjs_cdnurl=https://npm.taobao.org/dist/phantomjs
|
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1005 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1021 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.4 KiB |
@ -0,0 +1,6 @@
|
||||
export function setAppBounced(app) {
|
||||
let bounceId = app.dock.bounce();
|
||||
app.on('ready', () => {
|
||||
app.dock.cancelBounce(bounceId);
|
||||
})
|
||||
};
|
@ -0,0 +1,3 @@
|
||||
export function setIcon(app, iconString) {
|
||||
app.dock.setIcon(iconString);
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
// const electron = import('electron')
|
||||
const electron = window.require("electron");
|
||||
const ipcRenderer = electron.ipcRenderer;
|
||||
|
||||
export default store => {
|
||||
// 第一行初始化第一次的状态
|
||||
ipcRenderer.send('vuex-state', store.state)
|
||||
store.subscribe((mutation, { data = '', settings = '', player = {}, contextMenu = {}, liked = {} }) => {
|
||||
const copyState = { data, settings, player, contextMenu, liked }
|
||||
ipcRenderer.send('vuex-state', copyState)
|
||||
})
|
||||
store.subscribe((mutation, state) => {
|
||||
if (mutation.type === 'updateData') {
|
||||
ipcRenderer.send('updateData', state.data)
|
||||
}
|
||||
})
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
export default (store) => {
|
||||
store.subscribe((mutation, state) => {
|
||||
// console.log(mutation);
|
||||
localStorage.setItem("player", JSON.stringify(state.player));
|
||||
localStorage.setItem("settings", JSON.stringify(state.settings));
|
||||
localStorage.setItem("data", JSON.stringify(state.data));
|
||||
});
|
||||
};
|