LoaderPage.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <div class="main">
  3. <div class="part">
  4. <span class="greeting bold-font">{{ title }}</span>
  5. <span class="greeting">Добро пожаловать!</span>
  6. <span class="greeting">Поддерживаются форматы: fb2, fb2.zip, html, txt</span>
  7. </div>
  8. <div class="part center">
  9. <el-input ref="input" placeholder="URL книги" v-model="bookUrl">
  10. <el-button slot="append" icon="el-icon-search" @click="submitUrl"></el-button>
  11. </el-input>
  12. </div>
  13. <div class="part bottom">
  14. </div>
  15. </div>
  16. </template>
  17. <script>
  18. //-----------------------------------------------------------------------------
  19. import Vue from 'vue';
  20. import Component from 'vue-class-component';
  21. export default @Component({
  22. })
  23. class LoaderPage extends Vue {
  24. bookUrl = null;
  25. created() {
  26. this.commit = this.$store.commit;
  27. this.dispatch = this.$store.dispatch;
  28. this.config = this.$store.state.config;
  29. }
  30. mounted() {
  31. //недостатки сторонних ui
  32. this.$refs.input.$refs.input.addEventListener('keyup', (event) => {
  33. if (event.key == 'Enter')
  34. this.submitUrl();
  35. });
  36. }
  37. activated() {
  38. this.$refs.input.focus();
  39. }
  40. get title() {
  41. if (this.config.mode == 'omnireader')
  42. return 'Omni Reader - браузерная онлайн-читалка.';
  43. return 'Универсальная читалка книг и ресурсов интернета.';
  44. }
  45. submitUrl() {
  46. if (this.bookUrl)
  47. //loadUrl()
  48. ;
  49. }
  50. }
  51. //-----------------------------------------------------------------------------
  52. </script>
  53. <style scoped>
  54. .main {
  55. flex: 1;
  56. display: flex;
  57. flex-direction: column;
  58. }
  59. .part {
  60. flex: 1;
  61. display: flex;
  62. flex-direction: column;
  63. justify-content: center;
  64. align-items: center;
  65. }
  66. .greeting {
  67. font-size: 130%;
  68. line-height: 170%;
  69. }
  70. .bold-font {
  71. font-weight: bold;
  72. }
  73. .center {
  74. justify-content: flex-start;
  75. padding: 0 5px 0 5px;
  76. }
  77. .bottom {
  78. justify-content: flex-end;
  79. }
  80. .el-input {
  81. max-width: 600px;
  82. }
  83. </style>