diff --git a/package/component/src/component/page/index.vue b/package/component/src/component/page/index.vue index 127b2cf9..168f3f30 100644 --- a/package/component/src/component/page/index.vue +++ b/package/component/src/component/page/index.vue @@ -43,7 +43,8 @@ const props = withDefaults(defineProps(), { }); const limits = ref(props.limits); -const pages = props.pages / 2; +const pages = Math.ceil(props.pages / 2); + const inlimit = computed({ get() { return props.limit; @@ -52,7 +53,9 @@ const inlimit = computed({ emit("limit", v); }, }); + const maxPage = ref(0); + const totalPage = computed(() => { maxPage.value = Math.ceil(props.total / props.limit); let r: number[] = [], diff --git a/package/component/src/component/table/index.vue b/package/component/src/component/table/index.vue index e7e5bd4e..398b32b1 100644 --- a/package/component/src/component/table/index.vue +++ b/package/component/src/component/table/index.vue @@ -293,6 +293,7 @@ onMounted(() => { @@ -207,22 +207,24 @@ import { ref } from 'vue' export default { setup() { - const limit = ref(5) - const total = ref(9999) - const showCount = ref(true) - const showPage = ref(true) - const showLimit = ref(true) - const showRefresh = ref(true) - const showSkip = ref(true) + const limit1 = ref(5) + const total1 = ref(9999) + const showCount1 = ref(true) + const showPage1 = ref(true) + const showLimit1 = ref(true) + const showRefresh1 = ref(true) + const showSkip1 = ref(true) + const pages1 = ref(3); return { - limit, - total, - showCount, - showPage, - showLimit, - showRefresh, - showSkip + limit1, + total1, + pages1, + showCount1, + showPage1, + showLimit1, + showRefresh1, + showSkip1 } } } diff --git a/package/document/src/main.ts b/package/document/src/main.ts index 8db88cf8..21bc53d1 100644 --- a/package/document/src/main.ts +++ b/package/document/src/main.ts @@ -2,9 +2,8 @@ import Layout from "./App.vue"; import { App, createApp as _createApp } from "vue"; import { createRouter } from "./router/index"; import { Router } from "vue-router"; -import layui from "@layui/layui-vue"; import Store from "./store"; -import "@layui/layui-vue/lib/index.css"; +import layui from '../../component/src/index' import LayCode from "./components/LayCode.vue"; import LaySearch from "./components/LaySearch.vue"; import LayTableBox from "./components/LayTableBox.vue";