diff --git a/src/App.vue b/src/App.vue index e7ac112..d351d10 100644 --- a/src/App.vue +++ b/src/App.vue @@ -8,6 +8,8 @@ diff --git a/src/views/Add/Add.vue b/src/views/Add/Add.vue index 2045c10..ffd0901 100644 --- a/src/views/Add/Add.vue +++ b/src/views/Add/Add.vue @@ -7,8 +7,8 @@

{{id_cache?lang.title[1]:lang.title[0]}}

- +
@@ -53,6 +53,7 @@ export default { name: 'Add', data() { return { + clientHeight: '', title: '', user_name: '', password: '', @@ -71,7 +72,13 @@ export default { }, methods: { ...mapActions(['setRowData', 'setRowPwd']), - + // 修改md-app的最小高度 + changeFixed(clientHeight) { + //动态修改样式 + // console.log(clientHeight); + window.document.getElementsByClassName('md-content')[0].style.minHeight = clientHeight + 'px'; + window.document.documentElement.setAttribute('data-theme', this.settings.is_dark_mode ? 'dark' : 'light'); + }, // 初始化 init() { // 刷新vuex @@ -239,8 +246,20 @@ export default { console.log('临时语言系统加载完成') this.init() }, - mounted() {}, - watch: {}, + mounted() { + // 获取浏览器可视区域高度 + this.clientHeight = `${document.documentElement.clientHeight}`; + //document.body.clientWidth; + window.onresize = function temp() { + this.clientHeight = `${document.documentElement.clientHeight}`; + }; + }, + watch: { + // 如果 `clientHeight` 发生改变,这个函数就会运行 + clientHeight: function() { + this.changeFixed(this.clientHeight); + }, + }, beforeDestroy() {}, components: {} }; @@ -257,5 +276,8 @@ export default { margin: 0 !important; min-height: 1.2rem !important; } + .toolbar { + position: fixed !important; + } } diff --git a/src/views/Detail/Detail.vue b/src/views/Detail/Detail.vue index 9e94fb1..8a10255 100644 --- a/src/views/Detail/Detail.vue +++ b/src/views/Detail/Detail.vue @@ -13,12 +13,13 @@ +

{{content.user_name}}

- +
@@ -26,7 +27,7 @@

{{show_password? content.password : doitPassword}}

remove_red_eye - +
@@ -75,7 +76,8 @@ export default { content: {}, show_password: false, show_dialog: false, - lang:'' + lang:'', + clientHeight:'' }; }, computed: { @@ -92,7 +94,12 @@ export default { }, methods: { ...mapActions(['setRowData', 'setRowPwd']), - + // 修改md-app的最小高度 + changeFixed(clientHeight) { + //动态修改样式 + window.document.getElementsByClassName('md-app-content')[0].style.minHeight = clientHeight + 'px'; + window.document.documentElement.setAttribute('data-theme', this.settings.is_dark_mode ? 'dark' : 'light'); + }, // 初始化 init() { // 刷新vuex @@ -229,8 +236,20 @@ export default { console.log('临时语言系统加载完成') this.init() }, - mounted() {}, - watch: {}, + mounted() { + // 获取浏览器可视区域高度 + this.clientHeight = `${document.documentElement.clientHeight}`; + //document.body.clientWidth; + window.onresize = function temp() { + this.clientHeight = `${document.documentElement.clientHeight}`; + }; + }, + watch: { + // 如果 `clientHeight` 发生改变,这个函数就会运行 + clientHeight: function() { + this.changeFixed(this.clientHeight); + }, + }, beforeDestroy() {}, components: {} }; @@ -242,6 +261,9 @@ export default { width: 100%; min-height: 100%; background: #fff; + .md-toolbar { + position: fixed !important; + } .md-list-item-content { position: relative; label { @@ -266,7 +288,10 @@ export default { .icon { height: 24px; width: 24px; - color: grey; + color: gray; + } + .dark-theme-icon { + color: #fff !important; } .node { width: 100%; diff --git a/src/views/Home/Home.vue b/src/views/Home/Home.vue index ec83ab9..e403f43 100644 --- a/src/views/Home/Home.vue +++ b/src/views/Home/Home.vue @@ -23,7 +23,7 @@
- face + face

Canary Codebook

{{ user_infos.mail_addr }}

@@ -72,7 +72,7 @@ md-icon="devices_other" :md-label="lang.empty_state.label" :md-description="lang.empty_state.description" - v-if="show_list.length == 0" + v-if="show_list.length == 0 && !search_start" > {{lang.empty_state.button}} @@ -82,7 +82,7 @@

{{ code.user_name }}

- + add @@ -132,6 +132,7 @@ export default { // console.log(clientHeight); this.$refs.home.children[0].style.minHeight = clientHeight + 'px'; this.$refs.list_placeholder.parentNode.style.maxHeight = clientHeight + 'px'; + window.document.documentElement.setAttribute('data-theme', this.settings.is_dark_mode ? 'dark' : 'light'); }, // 初始化 @@ -429,4 +430,7 @@ export default { .md-app-scroller > div { overflow-y:scroll!important; } +.face { + color: #fff !important; +} diff --git a/src/views/Settings/Settings.vue b/src/views/Settings/Settings.vue index fb63837..41cdb5d 100644 --- a/src/views/Settings/Settings.vue +++ b/src/views/Settings/Settings.vue @@ -9,6 +9,7 @@ +
{{lang.subheader[0]}} @@ -45,7 +46,7 @@ brightness_6 {{lang.option_list[1]}} - + @@ -109,7 +110,8 @@ export default { snakebar_msg: '', // 初始化完成状态 has_init: false, - lang: '' + lang: '', + clientHeight:'' }; }, computed: { @@ -117,7 +119,14 @@ export default { }, methods: { ...mapActions(['setUserInfo', 'setRowData', 'setRowPwd', 'setSettings']), - + + // 修改md-app的最小高度 + changeFixed(clientHeight) { + //动态修改样式 + // console.log(clientHeight); + window.document.getElementsByClassName('md-content')[0].style.minHeight = clientHeight + 'px'; + window.document.documentElement.setAttribute('data-theme', this.settings.is_dark_mode ? 'dark' : 'light'); + }, // 初始化 init() { // 刷新vuex @@ -255,6 +264,7 @@ export default { } else { this.lang = lang().settings.EN } + window.document.documentElement.setAttribute('data-theme', this.settings.is_dark_mode ? 'dark' : 'light'); console.log('语言配置完成') this.snakebar_msg = this.lang.snakebar_msg.reset_settings; this.show_snackbar = true; @@ -285,8 +295,19 @@ export default { console.log('临时语言系统加载完成') this.init(); }, - mounted() {}, + mounted() { + // 获取浏览器可视区域高度 + this.clientHeight = `${document.documentElement.clientHeight}`; + //document.body.clientWidth; + window.onresize = function temp() { + this.clientHeight = `${document.documentElement.clientHeight}`; + }; + }, watch: { + // 如果 `clientHeight` 发生改变,这个函数就会运行 + clientHeight: function() { + this.changeFixed(this.clientHeight); + }, // 如果 `is_chinese` 发生改变,就会执行设置函数 is_chinese: function() { if (this.has_init) this.resetSettings(); @@ -327,6 +348,9 @@ export default { margin-right: -11px; margin-top: -11px; } + .toolbar { + position: fixed !important; + } }