1、修复页码器和vue3版本不兼容问题

master
chris 1 month ago
parent 90ef7b5ac9
commit a74f27e56c

@ -59,13 +59,16 @@ const props = defineProps({
} }
}) })
const emit = defineEmits(); const emit = defineEmits(['pagination']);
const limit = defineModel('limit');
const page = defineModel('page');
const currentPage = computed({ const currentPage = computed({
get() { get() {
return props.page return props.page
}, },
set(val) { set(val) {
emit('update:page', val) page.value = val
} }
}) })
const pageSize = computed({ const pageSize = computed({
@ -73,7 +76,7 @@ const pageSize = computed({
return props.limit return props.limit
}, },
set(val){ set(val){
emit('update:limit', val) limit.value = val
} }
}) })
function handleSizeChange(val) { function handleSizeChange(val) {

@ -89,8 +89,8 @@
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" v-model:page="queryParams.pageNum"
:limit.sync="queryParams.pageSize" v-model:limit="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />

@ -85,8 +85,8 @@
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" v-model:page="queryParams.pageNum"
:limit.sync="queryParams.pageSize" v-model:limit="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
@ -225,7 +225,7 @@ function handleUpdate(row) {
/** 提交按钮 */ /** 提交按钮 */
function submitForm() { function submitForm() {
validateForm.then(() => { validateForm().then(() => {
if (form.value.id != null) { if (form.value.id != null) {
updateProductsCategory(form.value).then(response => { updateProductsCategory(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功"); proxy.$modal.msgSuccess("修改成功");

@ -97,8 +97,8 @@
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" v-model:page="queryParams.pageNum"
:limit.sync="queryParams.pageSize" v-model:limit="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
@ -257,7 +257,7 @@ function handleUpdate(row) {
/** 提交按钮 */ /** 提交按钮 */
function submitForm() { function submitForm() {
validateForm.then(() => { validateForm().then(() => {
if (form.value.id != null) { if (form.value.id != null) {
updateProductsRecord(form.value).then(response => { updateProductsRecord(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功"); proxy.$modal.msgSuccess("修改成功");

@ -101,8 +101,8 @@
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" v-model:page="queryParams.pageNum"
:limit.sync="queryParams.pageSize" v-model:limit="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />

@ -127,8 +127,8 @@
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" v-model:page="queryParams.pageNum"
:limit.sync="queryParams.pageSize" v-model:limit="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />

Loading…
Cancel
Save