WIP: Switch Main/Welcome component
This commit is contained in:
parent
69e5fb3f1b
commit
4094a32ab2
20
src/components/Main.vue
Normal file
20
src/components/Main.vue
Normal file
|
@ -0,0 +1,20 @@
|
|||
<template>
|
||||
<div id="main">
|
||||
<!-- 仮置き -->
|
||||
<p>Main View</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from 'vue-property-decorator'
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
}
|
||||
})
|
||||
export default class Main extends Vue {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="postcss">
|
||||
</style>
|
|
@ -1,21 +1,26 @@
|
|||
<template>
|
||||
<div id="app" :style="styles">
|
||||
<Welcome/>
|
||||
<Welcome v-if="isStartup"/>
|
||||
<Main v-else/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { ipcRenderer } from 'electron'
|
||||
import { Component, Vue } from 'vue-property-decorator'
|
||||
|
||||
import Main from '@/components/Main.vue'
|
||||
import Welcome from '@/components/Welcome.vue'
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
Main,
|
||||
Welcome,
|
||||
},
|
||||
})
|
||||
export default class App extends Vue {
|
||||
public isDarkMode!: boolean
|
||||
public isStartup!: boolean
|
||||
public fontSize!: string
|
||||
|
||||
public get styles(): { [key: string]: string } {
|
||||
|
@ -28,11 +33,16 @@ export default class App extends Vue {
|
|||
|
||||
created() {
|
||||
this.isDarkMode = ipcRenderer.sendSync('dark-theme')
|
||||
this.isStartup = true // TODO: ipcで初回起動かのboolean値を取得する
|
||||
this.fontSize = '16px'
|
||||
}
|
||||
|
||||
mounted() {
|
||||
ipcRenderer.on('change-color-theme', () => this.isDarkMode = ipcRenderer.sendSync('dark-theme'))
|
||||
// TODO: アカウントか公開TLの追加を確認する。初回起動時のみ
|
||||
if (this.isStartup) {
|
||||
//ipcRenderer.once('add-account-or-timeline', () => this.isStartup = false)
|
||||
}
|
||||
}
|
||||
|
||||
beforeDestroy() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user