This commit is contained in:
不做码农 2022-06-02 19:34:56 +08:00
parent 4db966051e
commit 6357c7005a
5 changed files with 36 additions and 50 deletions

View File

@ -1,16 +1,25 @@
<template> <template>
<div :class="{ 'hidden': hidden }" class="pagination-container"> <div :class="{ hidden: hidden }" class="pagination-container">
<el-pagination small background v-model:current-page="currentPage" v-model:page-size="pageSize" :layout="layout" :page-sizes="pageSizes" <el-pagination
:pager-count="pagerCount" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" /> small
background
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:layout="layout"
:page-sizes="pageSizes"
:pager-count="pagerCount"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange" />
</div> </div>
</template> </template>
<script> <script>
// import { scrollTo } from "@/utils/scroll-to"; // import { scrollTo } from "@/utils/scroll-to";
import { computed } from "vue"; import { computed } from 'vue'
export default { export default {
name: "pagingation", name: 'pagingation',
emits: ["update:page", "update:limit", "pagination"], emits: ['update:page', 'update:limit', 'pagination'],
props: { props: {
total: { total: {
required: true, required: true,
@ -27,7 +36,7 @@ export default {
pageSizes: { pageSizes: {
type: Array, type: Array,
default() { default() {
return [10, 20, 30, 50]; return [10, 20, 30, 50, 100]
}, },
}, },
// 5 // 5
@ -37,7 +46,7 @@ export default {
}, },
layout: { layout: {
type: String, type: String,
default: "total, sizes, prev, pager, next, jumper", default: 'total, sizes, prev, pager, next, jumper',
}, },
background: { background: {
type: Boolean, type: Boolean,
@ -53,32 +62,31 @@ export default {
}, },
}, },
setup(props, { ctx, emit }) { setup(props, { ctx, emit }) {
const currentPage = computed({ const currentPage = computed({
get() { get() {
return props.page; return props.page
}, },
set(val) { set(val) {
emit("update:page", val); emit('update:page', val)
}, },
}); })
const pageSize = computed({ const pageSize = computed({
get() { get() {
return props.limit; return props.limit
}, },
set(val) { set(val) {
emit("update:limit", val); emit('update:limit', val)
}, },
}); })
function handleSizeChange(val) { function handleSizeChange(val) {
emit("pagination", { page: currentPage.value, limit: val }); emit('pagination', { page: currentPage.value, limit: val })
if (props.autoScroll) { if (props.autoScroll) {
// scrollTo(0, 800); // scrollTo(0, 800);
} }
} }
function handleCurrentChange(val) { function handleCurrentChange(val) {
emit("pagination", { page: val, limit: pageSize.value }); emit('pagination', { page: val, limit: pageSize.value })
if (props.autoScroll) { if (props.autoScroll) {
// scrollTo(0, 800); // scrollTo(0, 800);
} }
@ -89,9 +97,9 @@ export default {
pageSize, pageSize,
handleSizeChange, handleSizeChange,
handleCurrentChange, handleCurrentChange,
}; }
}, },
}; }
</script> </script>
<style scoped> <style scoped>
.pagination-container { .pagination-container {

View File

@ -2,7 +2,7 @@ export default {
/** /**
* 框架版本号 * 框架版本号
*/ */
version: '3.8.0', version: '3.8.1',
/** /**
* 网页标题 * 网页标题
*/ */

View File

@ -48,7 +48,7 @@
size="small" size="small"
icon="Document" icon="Document"
plain plain
@click="goTarget('http://www.izhaorui.cn/doc/#/changelog?id=v' + version)" @click="goTarget('http://www.izhaorui.cn/doc/changelog.html#' + version)"
>{{ $t('layout.changeLog') }} >{{ $t('layout.changeLog') }}
</el-link> </el-link>
</p> </p>

View File

@ -143,31 +143,9 @@
</el-icon> </el-icon>
</el-tooltip> </el-tooltip>
</template> </template>
<el-input v-model="info.genPath"> <el-input v-model="info.genPath"></el-input>
<template #append>
<el-dropdown>
<el-button type="primary">
最近路径快速选择
<el-icon>
<question-filled />
</el-icon>
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="info.genPath = '/'">恢复默认的生成基础路径</el-dropdown-item>
<el-dropdown-item @click="info.genPath = ''">本项目</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
</el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :lg="12">
<el-form-item prop="vuePath" label="Vue路径">
<el-input v-model="info.vuePath" placeholder="Vue项目所在绝对路径到项目根目录egD:/ZRAdmin-vue"></el-input>
</el-form-item>
</el-col> -->
<el-col :lg="12"> <el-col :lg="12">
<el-form-item prop="colNum" label="一行显示列"> <el-form-item prop="colNum" label="一行显示列">
<el-radio v-model="info.colNum" :label="12">2列</el-radio> <el-radio v-model="info.colNum" :label="12">2列</el-radio>