-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.vue
109 lines (93 loc) · 2.6 KB
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<template>
<div id="app-home" :style="{ height:( winHeight-32) + 'px' }">
<!-- 侧边栏 -->
<div class="side" :style="{ display: isHide }">
<q-bar class="q-electron-drag" style="background-color:#ecf0f6;">
<!-- <q-btn flat class="q-electron-drag--exception">-->
<img src="@/assets/logo.png" class="q-electron-drag--exception"/>
猿阅
<!-- </q-btn>-->
<q-space/>
</q-bar>
<side></side>
</div>
<!-- 主体内容 -->
<div class="main-container">
<top-tools/>
<q-splitter v-model="splitterModel" :limits="[20, 95]">
<template v-slot:before>
<!-- 文章列表 -->
<article-list :winHeight="( winHeight-32)"></article-list>
</template>
<template v-slot:after>
<!-- 文章内容 -->
<content :winHeight="( winHeight-32)"></content>
</template>
</q-splitter>
</div>
</div>
<setting-dialog/>
<update/>
</template>
<script setup lang="ts">
import {onMounted, ref, computed,getCurrentInstance} from "vue";
import ArticleList from "@/components/ArticleList.vue";
import Content from "@/components/Content.vue";
import Side from "./components/Side.vue";
import Update from "@/components/Update.vue";
import TopTools from "@/components/TopTools.vue";
import SettingDialog from "@/components/SettingDialog.vue";
const {ipcRenderer} = window.require("electron");
let splitterModel = ref(25) // start at 50%
let winHeight = ref<number>(document.documentElement.clientHeight);
let dialogStatus = ref(true)
//改变对话框状态
ipcRenderer.on('setting-dialog-done', async () => {
dialogStatus.value = true
})
/**
* 隐藏和显示
*/
let hide = ref(false)
let text = ref()
//计算属性
let isHide = computed(() => {
return hide.value ? 'none' : 'block'
});
//消息修改隐藏和显示
ipcRenderer.on("key-event-l", (ev) => {
hide.value = !hide.value;
});
onMounted(() => {
const $axios =getCurrentInstance()?.appContext.config.globalProperties.$axios ;
// $axios.get('https://rsshub.app/csdn/blog/csdngeeknews').then((response:any)=>{
// console.log(response.data)
// })
//获取窗口大小,指定高度
window.addEventListener(
"resize",
function () {
winHeight.value = document.documentElement.clientHeight;
},
false
);
});
</script>
<style>
#app-home {
display: flex;
flex-direction: row;
}
#app-home .main-container {
flex: 1;
}
#app-home .side {
width: 260px;
min-width: 260px;
}
.q-bar--standard > div {
font-weight: 400;
font-size: 14px !important;
}
</style>