From 303256afa1605978c2737391e391eabb154da78e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E5=84=80=E5=BC=8F?= <854085467@qq.com> Date: Wed, 6 Apr 2022 20:54:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20document=20=E5=BC=95=E7=94=A8=20main.ts?= =?UTF-8?q?=20=E4=BB=A5=E5=AE=9E=E7=8E=B0=E5=AE=9E=E6=97=B6=E8=B0=83?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/src/component/page/index.vue | 5 ++- .../component/src/component/table/index.vue | 1 + .../src/document/zh-CN/components/page.md | 32 ++++++++++--------- package/document/src/main.ts | 3 +- 4 files changed, 23 insertions(+), 18 deletions(-) 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";