Change class variable to initalize in created
`electron:serve` した時に表示が遅かったのでちょっと早くなる…気がする変更
This commit is contained in:
parent
6c2a98e139
commit
69e5fb3f1b
|
@ -64,8 +64,8 @@ interface TheDeskInfo {
|
|||
|
||||
@Component
|
||||
export default class About extends Vue {
|
||||
public thedeskInfo: TheDeskInfo = ipcRenderer.sendSync('thedesk-info')
|
||||
public isDarkMode: boolean = ipcRenderer.sendSync('dark-theme')
|
||||
public thedeskInfo!: TheDeskInfo
|
||||
public isDarkMode!: boolean
|
||||
|
||||
public get ctrHtml(): string {
|
||||
return this.contributors.map(contributer => {
|
||||
|
@ -105,13 +105,19 @@ export default class About extends Vue {
|
|||
}
|
||||
}
|
||||
|
||||
beforeDestroy() {
|
||||
ipcRenderer.eventNames().forEach(name => ipcRenderer.removeAllListeners(name))
|
||||
created() {
|
||||
this.thedeskInfo = ipcRenderer.sendSync('thedesk-info')
|
||||
this.isDarkMode = ipcRenderer.sendSync('dark-theme')
|
||||
}
|
||||
|
||||
mounted() {
|
||||
ipcRenderer.on('change-color-theme', () => this.isDarkMode = ipcRenderer.sendSync('dark-theme'))
|
||||
}
|
||||
|
||||
beforeDestroy() {
|
||||
ipcRenderer.eventNames().forEach(name => ipcRenderer.removeAllListeners(name))
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@ import Welcome from '@/components/Welcome.vue'
|
|||
},
|
||||
})
|
||||
export default class App extends Vue {
|
||||
public isDarkMode: boolean = ipcRenderer.sendSync('dark-theme')
|
||||
public fontSize: string = '16px'
|
||||
public isDarkMode!: boolean
|
||||
public fontSize!: string
|
||||
|
||||
public get styles(): { [key: string]: string } {
|
||||
return {
|
||||
|
@ -26,13 +26,18 @@ export default class App extends Vue {
|
|||
}
|
||||
}
|
||||
|
||||
beforeDestroy() {
|
||||
ipcRenderer.eventNames().forEach(name => ipcRenderer.removeAllListeners(name))
|
||||
created() {
|
||||
this.isDarkMode = ipcRenderer.sendSync('dark-theme')
|
||||
this.fontSize = '16px'
|
||||
}
|
||||
|
||||
mounted() {
|
||||
ipcRenderer.on('change-color-theme', () => this.isDarkMode = ipcRenderer.sendSync('dark-theme'))
|
||||
}
|
||||
|
||||
beforeDestroy() {
|
||||
ipcRenderer.eventNames().forEach(name => ipcRenderer.removeAllListeners(name))
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user