Add to HomeView main comp and SearchBar to Main component
This commit is contained in:
@@ -1,10 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="content-wrapper" :class="{ centered: isCentered }">
|
<div class="content-wrapper" :class="{ centered: isCentered }">
|
||||||
<slot></slot>
|
<slot>
|
||||||
|
<SearchBar />
|
||||||
|
</slot>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import SearchBar from './SearchBar.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ContentWrapper',
|
name: 'ContentWrapper',
|
||||||
props: {
|
props: {
|
||||||
@@ -13,9 +17,13 @@
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
SearchBar
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.content-wrapper {
|
.content-wrapper {
|
||||||
@@ -23,7 +31,7 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: flex-start; /* Выравниваем контент к верху */
|
justify-content: flex-start; /* Выравниваем контент к верху */
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
min-height: 100vh; /* Если нужно растянуть контейнер на всю высоту экрана */
|
min-height: 80vh; /* Если нужно растянуть контейнер на всю высоту экрана */
|
||||||
}
|
}
|
||||||
|
|
||||||
.centered {
|
.centered {
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
<template>
|
||||||
|
<div class="search-bar">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
placeholder="Поиск..."
|
||||||
|
v-model="searchQuery"
|
||||||
|
@keyup.enter="onSubmit"
|
||||||
|
/>
|
||||||
|
<button @click="onSubmit">Найти</button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'SearchBar',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
searchQuery: ''
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onSubmit() {
|
||||||
|
this.$emit('submit', this.searchQuery);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.search-bar {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-bar input {
|
||||||
|
flex-grow: 1;
|
||||||
|
padding: 10px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-bar button {
|
||||||
|
padding: 10px 20px;
|
||||||
|
background-color: #007bff;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import Header from '../components/Header.vue'
|
import Header from '../components/Header.vue'
|
||||||
import Footer from '../components/Footer.vue'
|
import Footer from '../components/Footer.vue'
|
||||||
|
import Main from '../components/Main.vue'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
Reference in New Issue
Block a user