当前位置: 首页> 财经> 产业 > 软件网站免费_网站源码大全免费的_国产系统2345_sem专员

软件网站免费_网站源码大全免费的_国产系统2345_sem专员

时间:2025/8/24 23:39:01来源:https://blog.csdn.net/sinat_34896766/article/details/144694285 浏览次数:0次
软件网站免费_网站源码大全免费的_国产系统2345_sem专员

组件封装代码如下:

<script setup lang="ts">
import { computed } from "vue";
const props = defineProps({size: {type: String,default() {return "medium";},},total: {type: Number,required: true,},page: {// 当前页码type: Number,default: 1,},limit: {type: Number,default: 10,},
});
const emit = defineEmits();
const currentPage = computed({set(val) {emit("update:page", val);},get() {return props.page;},
});
const pageSize = computed({set(val) {emit("update:limt", val);},get() {return props.limit;},
});
let handleCurrentChange = (page: any) => {emit("pagination", {page: page,limit: pageSize.value,});
};
let handleSizeChange = (page: any) => {emit("pagination", {currentPage: currentPage.value,limit: page,});
};
</script><template><div><n-paginationv-model:page="currentPage"v-model:page-size="pageSize":size="size":page-sizes="[10, 20, 30, 40]"show-quick-jumpershow-size-picker@update:page="handleCurrentChange"@update:page-size="handleSizeChange":item-count="total"><template #prefix>共{{ total }}条数据</template><template #goto>到</template><template #suffix><span class="goto-label">页</span><n-button size="small" type="primary" @click="handleCurrentChange(currentPage)">确定</n-button></template></n-pagination></div>
</template><style scoped></style>

使用代码如下:

<script setup lang="ts">
import Pagination from '@/components/Pagination/index.vue'const page = ref(4)
const pageSize = ref(10)
const totalCount = ref(999)const pageChange = (val) => {page.value = val.pagepageSize.value = val.limit
}
</script><template><n-space><div class="flex items-center justify-end mt-[50px]"><paginationv-model:page="page"v-model:limit="pageSize"v-show="totalCount > 0":total="totalCount"@pagination="pageChange"></pagination></div><!-- <pagination :page="page" @changePage="pageFn" :totalCount="totalCount"></pagination> --></n-space>
</template><style scoped lang="scss"></style>

关键字:软件网站免费_网站源码大全免费的_国产系统2345_sem专员

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: