support on-demand loading

This commit is contained in:
就眠儀式 2022-01-29 09:53:48 +08:00
parent 366854317a
commit 71e56f3fe7
2 changed files with 17 additions and 14 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@layui/layui-vue", "name": "@layui/layui-vue",
"version": "0.3.6-alpha.3", "version": "0.3.6-alpha.4",
"author": "SleepRite", "author": "SleepRite",
"license": "MIT", "license": "MIT",
"description": "a component library for Vue 3 base on layui-vue", "description": "a component library for Vue 3 base on layui-vue",
@ -65,9 +65,9 @@
"prettier": "^2.5.1", "prettier": "^2.5.1",
"prismjs": "^1.25.0", "prismjs": "^1.25.0",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"rollup": "^2.64.0", "rollup": "^2.66.1",
"typescript": "^4.5.2", "typescript": "^4.5.5",
"vite": "2.7.12", "vite": "2.7.13",
"vite-plugin-md": "^0.11.6" "vite-plugin-md": "^0.11.6"
}, },
"files": [ "files": [

View File

@ -16,6 +16,9 @@ import {
import { Recordable } from "../../types"; import { Recordable } from "../../types";
import { guid } from "../../utils/guidUtil"; import { guid } from "../../utils/guidUtil";
import LayCheckbox from "../checkbox"; import LayCheckbox from "../checkbox";
import LayDropdown from "../dropdown";
import LayPage from "../page";
import LayIcon from "../icon";
import "./index.less"; import "./index.less";
const tableId = guid(); const tableId = guid();
@ -119,23 +122,23 @@ const print = function () {
<slot name="toolbar"></slot> <slot name="toolbar"></slot>
</div> </div>
<div v-if="defaultToolbar" class="layui-table-tool-self"> <div v-if="defaultToolbar" class="layui-table-tool-self">
<lay-dropdown> <LayDropdown>
<div class="layui-inline" title="筛选列" lay-event="LAYTABLE_COLS"> <div class="layui-inline" title="筛选列" lay-event="LAYTABLE_COLS">
<i class="layui-icon layui-icon-cols"></i> <i class="layui-icon layui-icon-cols"></i>
</div> </div>
<template #content> <template #content>
<div style="padding: 10px"> <div style="padding: 10px">
<lay-checkbox <LayCheckbox
v-for="column in columns" v-for="column in columns"
:key="column" :key="column"
v-model="tableColumnKeys" v-model="tableColumnKeys"
skin="primary" skin="primary"
:label="column.key" :label="column.key"
>{{ column.title }}</lay-checkbox >{{ column.title }}</LayCheckbox
> >
</div> </div>
</template> </template>
</lay-dropdown> </LayDropdown>
<div <div
class="layui-inline" class="layui-inline"
title="打印" title="打印"
@ -155,7 +158,7 @@ const print = function () {
<tr> <tr>
<th v-if="checkbox" class="layui-table-col-special"> <th v-if="checkbox" class="layui-table-col-special">
<div class="layui-table-cell laytable-cell-checkbox"> <div class="layui-table-cell laytable-cell-checkbox">
<lay-checkbox <LayCheckbox
v-model="allChecked" v-model="allChecked"
skin="primary" skin="primary"
label="all" label="all"
@ -188,7 +191,7 @@ const print = function () {
> >
<td v-if="checkbox" class="layui-table-col-special"> <td v-if="checkbox" class="layui-table-col-special">
<div class="layui-table-cell laytable-cell-checkbox"> <div class="layui-table-cell laytable-cell-checkbox">
<lay-checkbox <LayCheckbox
v-model="tableSelectedKeys" v-model="tableSelectedKeys"
skin="primary" skin="primary"
:label="data[id]" :label="data[id]"
@ -229,7 +232,7 @@ const print = function () {
</div> </div>
</div> </div>
<div v-if="page" class="layui-table-page"> <div v-if="page" class="layui-table-page">
<lay-page <LayPage
:total="page.total" :total="page.total"
:limit="page.limit" :limit="page.limit"
show-page show-page
@ -237,9 +240,9 @@ const print = function () {
show-skip show-skip
@jump="change" @jump="change"
> >
<template #prev><lay-icon type="layui-icon-left" /></template> <template #prev><LayIcon type="layui-icon-left" /></template>
<template #next><lay-icon type="layui-icon-right" /></template> <template #next><LayIcon type="layui-icon-right" /></template>
</lay-page> </LayPage>
</div> </div>
</div> </div>
</div> </div>