12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <template>
- <div class="simple-pagination p-2">
- <van-pagination
- v-model="currentPage"
- :total-items="total"
- :items-per-page="10"
- :show-page-size="6"
- :force-ellipses="true"
- :mode="mode"
- @change="$emit('change', currentPage)"
- />
- </div>
- </template>
- <script>
- import { mapGetters } from 'vuex'
- export default {
- props: {
- total: {
- type: Number,
- default: 1000,
- },
- },
- data() {
- return {
- currentPage: 1,
- }
- },
- computed: {
- ...mapGetters(['isPc']),
- mode() {
- return this.isPc ? 'multi' : 'simple'
- },
- },
- }
- </script>
- <style scoped lang="scss">
- @media screen and (min-width: 768px) {
- .simple-pagination {
- display: flex;
- justify-content: center;
- .van-pagination {
- ::v-deep {
- .van-pagination__item {
- margin-left: 4px;
- margin-right: 4px;
- color: #bc1724;
- &:active {
- color: #fff;
- background-color: #bc1724;
- }
- }
- .van-pagination__prev,
- .van-pagination__next {
- background: transparent !important;
- color: #101010;
- &::after {
- border-color: transparent !important;
- }
- &:hover {
- color: #bc1724;
- }
- }
- .van-pagination__item--active {
- background-color: #bc1724 !important;
- color: #fff;
- }
- }
- }
- }
- }
- @media screen and (max-width: 768px) {
- .van-pagination {
- ::v-deep {
- .van-pagination__prev,
- .van-pagination__next {
- color: #101010;
- &::after {
- border-color: transparent !important;
- }
- &:active {
- color: #fff;
- background-color: #bc1724;
- }
- }
- }
- }
- }
- </style>
|