feat: add page component v-model props

This commit is contained in:
就眠儀式
2022-03-17 09:48:27 +08:00
parent 8400cc879e
commit 569d081553
4 changed files with 100 additions and 96 deletions

View File

@@ -13,7 +13,7 @@
::: demo 使用 `lay-page` 标签, 创建分页
<template>
<lay-page :limit="limit" @limit="limit = $event" :total="total" :show-page="showPage"></lay-page>
<lay-page v-model="currentPage" :limit="limit" @limit="limit = $event" :total="total" :show-page="showPage"></lay-page>
</template>
<script>
@@ -25,11 +25,13 @@ export default {
const limit = ref(20)
const total = ref(100)
const showPage = ref(true)
const currentPage = ref(2);
return {
limit,
total,
showPage
showPage,
currentPage
}
}
}

View File

@@ -151,7 +151,8 @@ export default {
const page = {
total: 100,
limit: 10
limit: 10,
current: 2
}
const change = function({ current }){