Skip to content

Pagination when size is change,the page change function will be trigger at the same time #5293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
2071534594 opened this issue Feb 25, 2022 · 3 comments
Closed
1 task done
Labels

Comments

@2071534594
Copy link

2071534594 commented Feb 25, 2022

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.0.0-beta.10

Environment

window10, "browser chrome": "版本 98.0.4758.102(正式版本)", "vue": "3.2.29"

Reproduction link

Edit on CodeSandbox

Steps to reproduce

代码
main.js

import { createApp } from "vue";
import App from "./App.vue";
import "ant-design-vue/dist/antd.css";
import { Pagination } from "ant-design-vue";

createApp(App).use(Pagination).mount("#app");

APP.vue

<template>
<a-pagination
size="small"
:total="topTable.total"
:showSizeChanger="true"
:pageSizeOptions="topTable.pageSizeOptions"
:pageSize="topTable.pageSize"
:current="topTable.current"
@showSizeChange="sizeChange"
@change="pageChange"
>
</a-pagination>
</template>

<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
name: "App",
setup() {
const topTable = {
pageSize: 50,
pageSizeOptions: ["50", "100", "200"],
total: 0,
current: 1,
};
const sizeChange = () => {
console.debug("sizeChange");
};
const pageChange= (current, size) => {
console.debug("pageChange");
};
return {
topTable,
sizeChange,
pageChange,
};
},
});
</script>

<style lang="css">
</style>

1.设置可选每页大小pageSize为50,100,200
2.选择从50条/页改为100条/页的

What is expected?

只触发showSizeChange方法,console只打印“sizeChange”

What is actually happening?

实际是同时触发了showSizeChange方法与change方法,打印了“sizeChange”、“pageChange”,不应该触发页发生改变的方法

@tangjinzhou
Copy link
Member

预期行为,我们会优化文档

@2071534594
Copy link
Author

这种是正常的么,这个不是bug么?请问这样不是无法确定当前到底是触发的“sizeChange”、“pageChange”,如此两个回调函数都会被执行了

预期行为,我们会优化文档

tangjinzhou added a commit that referenced this issue Mar 12, 2022
* style: affix & util

* feat(alert): add customIcon slot

* feat(anchor): ts type

* style: auto-complete

* feat: avatar add crossOrigin & maxPopoverTrigger

* style(backTop): v-show instead v-if

* style: badge

* style: breadcrumb

* feat: button add global size

* feat: update i18n

* feat: picker add disabledTime

* test: update snap

* doc: update img url

* style: fix Card tabs of left position

* doc: update cascader doc

* feat: collapse

* style: comment

* style: configprovider

* feat: date-picker add soem icon slot

* style: update descriptions style

* feat: add divider orientationMargin

* doc: update drawer

* feat: dropdown add destroyPopupOnHide & loading

* style: update empty

* feat: form add labelWrap

* style: update grid

* test: update grid snap

* fix: image ts error

* fix: mentions cannot select, close #5233

* doc: update pagination change info, close #5293

* fix: table dynamic expand error, close #5295

* style: remove not use

* release 3.0.0-beta.11

* doc: update typo

* feat: input add showCount

* feat: inputNumber add prefix slot

* style: update layout

* style: update list

* feat: add locale i18

* style: update locale ts

* style: update mentions

* feat: menu divider add dashed

* perf: menu

* perf: menu animate

* feat: modal method add wrapClassName

* style: update pageheader

* feat: update pagination ts

* feat: confirm add showCancel & promise

* doc: update popover

* style: update progress

* style: radio

* style: update rate、result、row

* feat: select add fieldNames

* feat: add skeleton button & input

* feat: spin tip support slot

* style: slider & space

* stype: update steps ts type

* style: update switch

* feat: table add tree filter

* test: update input sanp

* feat: table add filterMode...

* fix: tree autoExpandParent bug

* test: update input snap

* doc: tabs add destroyInactiveTabPane

* style: update tag

* style: update timeline & time-picker

* fix: Tooltip arrowPointAtCenter 1px shift bug

* feat: typography add enterEnterIcon triggerType

* doc: update tree-select

* fix: deps and TypeScript types

* style: udpate transfer

* style: update style

* doc: add colorScheme

* chore: add css var builg

* doc: sort api

* style: lint code

* doc: add css var

* test: update snap

* chore: add pre script

* chore: update lint

* perf: collapse animate

* perf: collapse tree

* perf: typography shaking when edit

* doc: update auto-complete demo

* fix: table tree not have animate

* feat: deprecated dropdown center placement

* feat: deprecated dropdown center placement

* test: update snap
@github-actions
Copy link

github-actions bot commented Mar 2, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants