Commit 07f400e572cd8c66bbf63ca98d98f828064f92d7

Authored by 梁灏
1 parent 472b4ff1

fixed #136

add on-page-size-change event
src/components/date-picker/base/date-table.vue
... ... @@ -186,8 +186,6 @@
186 186 const cell = this.cells[parseInt(event.target.getAttribute('index'))];
187 187 if (cell.disabled) return;
188 188  
189   -
190   -
191 189 const newDate = this.getDateOfCell(cell);
192 190  
193 191 if (this.selectionMode === 'range') {
... ...
src/components/page/page.vue
... ... @@ -224,6 +224,7 @@
224 224 onSize (pageSize) {
225 225 this.pageSize = pageSize;
226 226 this.changePage(1);
  227 + this.$emit('on-page-size-change', pageSize);
227 228 },
228 229 onPage (page) {
229 230 this.changePage(page);
... ...
test/routers/page.vue
1 1 <template>
2   - <Page :total="1000" show-sizer show-elevator show-total class="classr" :style="{float: 'right'}"></Page>
  2 + <Page :total="1000" show-sizer show-elevator show-total class="classr" :style="{float: 'right'}" @on-page-size-change="pc"></Page>
3 3 <br><br>
4 4 <Page :total="1000" show-sizer show-elevator show-total size="small" class="classr2"></Page>
5 5 <br><br>
... ... @@ -8,6 +8,11 @@
8 8 <script>
9 9 import { Page } from 'iview';
10 10 export default {
11   - components: { Page }
  11 + components: { Page },
  12 + methods: {
  13 + pc (page) {
  14 + console.log(page)
  15 + }
  16 + }
12 17 }
13 18 </script>
... ...