-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Billing-Wise/K5P-51/feat/상품및회원컴포넌트
[feat] 공통 컴포넌트 개발
- Loading branch information
Showing
17 changed files
with
595 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<template> | ||
<div class="pagination-bar"> | ||
<div class="spacer"></div> | ||
<PageChoiceVue :store="store"/> | ||
<SizeChoice :store="store"/> | ||
</div> | ||
|
||
</template> | ||
|
||
<script> | ||
import PageChoiceVue from './pagination/PageChoice.vue' | ||
import SizeChoice from './pagination/SizeChoice.vue'; | ||
export default { | ||
name: 'PaginationBarVue', | ||
components:{ | ||
SizeChoice, | ||
PageChoiceVue | ||
}, | ||
props: { | ||
store: { | ||
type: Object, | ||
required: true | ||
} | ||
}, | ||
data() { | ||
return { | ||
page: 1, | ||
size: 10 | ||
}}, | ||
computed: { | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.pagination-bar { | ||
display: grid; | ||
grid-template-columns: 1fr auto 1fr; | ||
align-items: center; | ||
width: 100%; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<template> | ||
<Button class="icon-btn" @click="func"> | ||
<span>{{ title }}</span> | ||
<i :class="icon"></i> | ||
</Button> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'ColorIconBtnVue', | ||
props: { | ||
title: String, | ||
icon: String, | ||
func: Function | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.icon-btn { | ||
@include flex-box(row, center, 10px); | ||
@include base-button(); | ||
padding: 7px 15px; | ||
background-color: $theme-color; | ||
color: white; | ||
border: none; | ||
i { | ||
font-size: 22px | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<template> | ||
<div class="search-input" @keydown.enter="search"> | ||
<input | ||
type="text" | ||
:placeholder="title" | ||
:value="modelValue" | ||
@input="$emit('update:modelValue', $event.target.value)"> | ||
<i class="bi bi-search" @click="search"></i> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'SearchInputtVue', | ||
props: { | ||
'title' : String, | ||
'modelValue': String, | ||
'search': Function | ||
}, | ||
emits: ['update:modelValue'] | ||
} | ||
</script> | ||
|
||
<style lang='scss' scoped> | ||
.search-input { | ||
@include flex-box(row, center, 10px); | ||
background-color: white; | ||
width: 300px; | ||
padding: 5px 15px; | ||
border-radius: 20px; | ||
border: $theme-color solid 2px; | ||
input { | ||
width: 100%; | ||
border: none; | ||
font-weight: bold; | ||
&:focus { | ||
outline: none; | ||
} | ||
} | ||
i { | ||
font-size: 20px; | ||
@include base-icon; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<template> | ||
<div class="page-choice"> | ||
<div class="btn-box"> | ||
<div class="move-icon" @click="this.store.setPage(0)"><<</div> | ||
<div class="move-icon" @click="this.store.setPage(store.page - 1)"><</div> | ||
</div> | ||
<div class="number-box"> | ||
<div | ||
v-for="page in nowPageNumbers" | ||
@click="setPage(page)" | ||
:key="page" | ||
:class="{ 'active': store.page === page }" | ||
class="page-number"> | ||
<span>{{ page + 1 }}</span> | ||
</div> | ||
</div> | ||
<div class="btn-box"> | ||
<div class="move-icon" @click="this.store.setPage(store.page + 1)">></div> | ||
<div class="move-icon" @click="this.store.setPage(store.maxPage)">>></div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name : "PageChoiceVue", | ||
props: { | ||
store: { | ||
type: Object, | ||
required: true | ||
} | ||
}, | ||
computed: { | ||
nowMaxPage() { | ||
return this.store.page + 2 < this.store.maxPage ? this.store.page + 2 : this.store.maxPage; | ||
}, | ||
nowLeastPage() { | ||
return this.store.page - 2 > 0 ? this.store.page - 2 : 0; | ||
}, | ||
nowPageNumbers() { | ||
const pages = []; | ||
for (let i = this.nowLeastPage; i <= this.nowMaxPage; i++) { | ||
pages.push(i); | ||
} | ||
return pages; | ||
} | ||
}, | ||
methods: { | ||
setPage(page) { | ||
this.store.setPage(page); | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.page-choice { | ||
@include flex-box(row, center, 20px); | ||
.btn-box { | ||
@include flex-box(row, center, 10px) | ||
} | ||
.number-box { | ||
@include flex-box(row, center, 15px) | ||
} | ||
} | ||
.move-icon { | ||
@include flex-box(row, center, 0px); | ||
@include base-icon; | ||
width: 32px; | ||
height: 32px; | ||
background-color: $theme-color; | ||
border-radius: 50%; | ||
font-size: 14px; | ||
font-weight: bold; | ||
color : white; | ||
} | ||
.page-number { | ||
@include flex-box(row, center, 0px); | ||
@include base-icon; | ||
font-weight: bold; | ||
font-size: 14px; | ||
} | ||
.active { | ||
width: 28px; | ||
height: 28px; | ||
background-color: $theme-color; | ||
border-radius: 50%; | ||
font-size: 18px !important;/// | ||
color : white; | ||
} | ||
</style> |
Oops, something went wrong.