| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <template>
- <div class="page-wrap" v-if="total/1.0/pageSize>1">
- <el-pagination
- :current-page.sync="currentPage"
- :page-size="pageSize"
- layout="prev, pager, next"
- :total="total"
- prev-text="上一页"
- next-text="下一页"
- @current-change="handleCurrentChange">
- </el-pagination>
- </div>
- </template>
- <script>
- export default {
- data () {
- return {
- nowPage: 1,
- currentPage: 1
- }
- },
- watch: {
- current: function () {
- this.handleCurrentChange()
- }
- },
- props: ['current', 'total', 'pageSize'],
- methods: {
- handleCurrentChange: function (changedPage) {
- this.$emit('childEvent', changedPage)
- }
- }
- }
- </script>
- <style>
- .page-wrap a {
- color: #333;
- background: 0 0;
- text-decoration: none;
- outline: 0;
- cursor: pointer;
- transition: color .2s ease;
- }
- .el-pagination {
- padding: 0;
- }
- .el-pagination .btn-next {
- border-top-right-radius: 4px;
- border-bottom-right-radius: 4px;
- border: 1px solid #ddd;
- height:30px;
- margin-right:10px;
- padding:0 10px;
- text-align: center;
- }
- .el-pagination .btn-prev {
- border-top-left-radius: 4px;
- border-bottom-left-radius: 4px;
- border: 1px solid #ddd;
- height:30px;
- margin-right:10px;
- padding:0 10px;
- text-align: center;
- }
- .el-pager li{
- color: #333;
- text-decoration: none;
- background-color: #fff;
- border: 1px solid #ddd;
- font-size: 10px;
- width: 33px;
- height: 30px;
- margin-right:10px;
- }
- .el-pager li:not(.active):hover, .el-pagination button:hover {
- z-index: 3;
- color: #fff;
- background-color: #333;
- border-color: #333;
- }
- .el-pager li.active {
- background: #333!important;
- color:#fff;
- }
- .el-pagination button.disabled {
- color: #333;
- background-color: #fff;
- cursor: not-allowed;
- }
- .pagination {
- display: inline-block;
- padding-left: 0;
- margin: 20px 0;
- border-radius: 4px;
- }
- .pagination>li {
- display: inline;
- }
- input.page-number {
- vertical-align: inherit;
- display: inline-block;
- width: 40px;
- height: 31px;
- padding: 6px 6px;
- font-size: 14px;
- line-height: 1.42857143;
- color: #9B9792;
- text-align: center;
- background-color: #F6F5F4;
- background-image: none;
- border: 1px solid #ccc;
- border-top-left-radius: 4px;
- border-bottom-left-radius: 4px;
- box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
- transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
- }
- .page-a {
- background: #5078cb !important;
- color: #fff !important;
- float: right!important;
- }
- .page-a {
- color: #fff;
- border-color: #4574e8;
- padding: 6px 6px!important;
- font-size: 14px!important;
- border-top-right-radius: 4px!important;
- border-bottom-right-radius: 4px!important;
- text-decoration: none;
- height: 31px;
- }
- .page-wrap{
- text-align: center;
- margin: 30px 0;
- }
- .page-wrap ul, .page-wrap div {
- display: inline-block;
- margin: 0;
- }
- input.page-number {
- -moz-appearance:textfield;
- }
- input.page-number::-webkit-inner-spin-button,
- input.page-number::-webkit-outer-spin-button {
- -webkit-appearance: none;
- margin: 0;
- }
- .el-pager li.active+li {
- border: 1px solid #ccc;
- }
- </style>
|