Работа над LoaderPage
This commit is contained in:
@@ -1,13 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="part">
|
<div class="part">
|
||||||
|
<span class="greeting bold-font">{{ title }}</span>
|
||||||
|
<span class="greeting">Добро пожаловать!</span>
|
||||||
|
<span class="greeting">Поддерживаются форматы: fb2, fb2.zip, html, txt</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="part">
|
<div class="part center">
|
||||||
|
<el-input ref="input" placeholder="URL книги" v-model="bookUrl">
|
||||||
|
<el-button slot="append" icon="el-icon-search" @click="submitUrl"></el-button>
|
||||||
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
<div class="part bottom">
|
<div class="part bottom">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -20,13 +23,40 @@ import Component from 'vue-class-component';
|
|||||||
export default @Component({
|
export default @Component({
|
||||||
})
|
})
|
||||||
class LoaderPage extends Vue {
|
class LoaderPage extends Vue {
|
||||||
|
bookUrl = null;
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
|
this.commit = this.$store.commit;
|
||||||
|
this.dispatch = this.$store.dispatch;
|
||||||
|
this.config = this.$store.state.config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
//недостатки сторонних ui
|
||||||
|
this.$refs.input.$refs.input.addEventListener('keyup', (event) => {
|
||||||
|
if (event.key == 'Enter')
|
||||||
|
this.submitUrl();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
activated() {
|
||||||
|
this.$refs.input.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
get title() {
|
||||||
|
if (this.config.mode == 'omnireader')
|
||||||
|
return 'Omni Reader - браузерная онлайн-читалка.';
|
||||||
|
return 'Универсальная читалка книг и ресурсов интернета.';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
submitUrl() {
|
||||||
|
if (this.bookUrl)
|
||||||
|
//loadUrl()
|
||||||
|
;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// justify-content: space-between;
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.main {
|
.main {
|
||||||
@@ -35,7 +65,6 @@ class LoaderPage extends Vue {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.part {
|
.part {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -44,8 +73,25 @@ class LoaderPage extends Vue {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.greeting {
|
||||||
|
font-size: 130%;
|
||||||
|
line-height: 170%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bold-font {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.center {
|
||||||
|
justify-content: flex-start;
|
||||||
|
padding: 0 5px 0 5px;
|
||||||
|
}
|
||||||
|
|
||||||
.bottom {
|
.bottom {
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-input {
|
||||||
|
max-width: 600px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -94,6 +94,9 @@ class Reader extends Vue {
|
|||||||
get componentActive() {
|
get componentActive() {
|
||||||
let result = '';
|
let result = '';
|
||||||
|
|
||||||
|
if (this.loaderActive)
|
||||||
|
result = 'LoaderPage';
|
||||||
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
this.commit('reader/setLoaderActive', true);
|
this.commit('reader/setLoaderActive', true);
|
||||||
result = 'LoaderPage';
|
result = 'LoaderPage';
|
||||||
|
|||||||
@@ -47,12 +47,16 @@ import './theme/header.css';
|
|||||||
import ElMain from 'element-ui/lib/main';
|
import ElMain from 'element-ui/lib/main';
|
||||||
import './theme/main.css';
|
import './theme/main.css';
|
||||||
|
|
||||||
|
import ElInput from 'element-ui/lib/input';
|
||||||
|
import './theme/input.css';
|
||||||
|
|
||||||
const ElNotification = () => import('element-ui/lib/notification');
|
const ElNotification = () => import('element-ui/lib/notification');
|
||||||
import './theme/notification.css';
|
import './theme/notification.css';
|
||||||
|
|
||||||
const components = {
|
const components = {
|
||||||
ElMenu, ElMenuItem, ElButton, ElCheckbox, ElTabs, ElTabPane, ElTooltip,
|
ElMenu, ElMenuItem, ElButton, ElCheckbox, ElTabs, ElTabPane, ElTooltip,
|
||||||
ElContainer, ElAside, ElMain, ElHeader,
|
ElContainer, ElAside, ElMain, ElHeader,
|
||||||
|
ElInput,
|
||||||
ElNotification
|
ElNotification
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user