️(git): update issues template

This commit is contained in:
就眠儀式 2022-08-12 10:53:50 +08:00
parent 051ba684ca
commit b2c3327ee4
2 changed files with 675 additions and 602 deletions

View File

@ -41,9 +41,11 @@ const props = withDefaults(defineProps<LayPageProps>(), {
const { t } = useI18n(); const { t } = useI18n();
const slots = useSlots(); const slots = useSlots();
const maxPage = ref(0);
const limits = ref(props.limits); const limits = ref(props.limits);
const pages = Math.floor(props.pages / 2); const pages = Math.floor(props.pages / 2);
const currentPage: Ref<number> = ref(props.modelValue);
const currentPageShow: Ref<number> = ref(currentPage.value);
const inlimit = computed({ const inlimit = computed({
get() { get() {
return props.limit; return props.limit;
@ -53,8 +55,6 @@ const inlimit = computed({
}, },
}); });
const maxPage = ref(0);
const totalPage = computed(() => { const totalPage = computed(() => {
maxPage.value = Math.ceil(props.total / props.limit); maxPage.value = Math.ceil(props.total / props.limit);
let r: number[] = [], let r: number[] = [],
@ -73,9 +73,6 @@ const totalPage = computed(() => {
return r; return r;
}); });
const currentPage: Ref<number> = ref(props.modelValue);
const currentPageShow: Ref<number> = ref(currentPage.value);
const emit = defineEmits(["jump", "limit", "update:modelValue"]); const emit = defineEmits(["jump", "limit", "update:modelValue"]);
const prev = function () { const prev = function () {
@ -115,9 +112,10 @@ watch(currentPage, function () {
emit("jump", { current: currentPage.value }); emit("jump", { current: currentPage.value });
emit("update:modelValue", currentPage.value); emit("update:modelValue", currentPage.value);
}); });
watch( watch(
() => props.modelValue, () => props.modelValue,
function () { () => {
currentPage.value = props.modelValue; currentPage.value = props.modelValue;
currentPageShow.value = currentPage.value; currentPageShow.value = currentPage.value;
} }

File diff suppressed because it is too large Load Diff