Рефакторинг
This commit is contained in:
@@ -1,13 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div ref="main" class="main">
|
<div ref="main" class="main">
|
||||||
<div class="window">
|
<Window>
|
||||||
<div class="header">
|
<template slot="header">
|
||||||
<span class="header-text">Прочитаные книги:</span>
|
Прочитаные книги:
|
||||||
</div>
|
</template>
|
||||||
|
|
||||||
<div class="list">
|
<div class="list">
|
||||||
Test
|
Test
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Window>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -16,11 +17,17 @@
|
|||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import Component from 'vue-class-component';
|
import Component from 'vue-class-component';
|
||||||
|
|
||||||
|
import Window from '../../share/Window.vue';
|
||||||
|
|
||||||
export default @Component({
|
export default @Component({
|
||||||
|
components: {
|
||||||
|
Window,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
class HistoryPage extends Vue {
|
class HistoryPage extends Vue {
|
||||||
created() {
|
created() {
|
||||||
this.commit = this.$store.commit;
|
this.commit = this.$store.commit;
|
||||||
|
this.reader = this.$store.state.reader;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -35,28 +42,6 @@ class HistoryPage extends Vue {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.window {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
min-width: 200px;
|
|
||||||
max-width: 600px;
|
|
||||||
background-color: #f5f7fa;
|
|
||||||
margin: 10px;
|
|
||||||
border: 1px solid black;
|
|
||||||
box-shadow: 3px 3px 5px black;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
height: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-text {
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list {
|
.list {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
|
|||||||
47
client/components/share/Window.vue
Normal file
47
client/components/share/Window.vue
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<template>
|
||||||
|
<div class="window">
|
||||||
|
<div class="header">
|
||||||
|
<span class="header-text"><slot name="header"></slot></span>
|
||||||
|
</div>
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
import Vue from 'vue';
|
||||||
|
import Component from 'vue-class-component';
|
||||||
|
|
||||||
|
export default @Component({
|
||||||
|
})
|
||||||
|
class Window extends Vue {
|
||||||
|
created() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.window {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-width: 200px;
|
||||||
|
max-width: 600px;
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
margin: 10px;
|
||||||
|
border: 1px solid black;
|
||||||
|
box-shadow: 3px 3px 5px black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-text {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user