feat(table): 新增 defaultToolbar 属性, 用于开启默认工具栏

This commit is contained in:
就眠仪式 2021-10-11 04:10:14 +08:00
parent 223e377085
commit 94b37a19f9
2 changed files with 4 additions and 3 deletions

View File

@ -126,7 +126,7 @@ export default {
::: demo
<template>
<lay-table :columns="columns" :dataSource="dataSource">
<lay-table :columns="columns" :dataSource="dataSource" default-toolbar="true">
<template v-slot:toolbar>
<lay-button>新增</lay-button>
<lay-button>删除</lay-button>

View File

@ -4,13 +4,13 @@
<div
class="layui-form layui-border-box layui-table-view layui-table-view-1"
>
<div class="layui-table-tool">
<div class="layui-table-tool" v-if="defaultToolbar || slot.toolbar">
<div class="layui-table-tool-temp">
<div class="layui-btn-container">
<slot name="toolbar"></slot>
</div>
</div>
<div class="layui-table-tool-self">
<div class="layui-table-tool-self" v-if="defaultToolbar">
<div class="layui-inline" title="筛选列" lay-event="LAYTABLE_COLS">
<i class="layui-icon layui-icon-cols"></i>
</div>
@ -133,6 +133,7 @@ const props =
dataSource?: Object[]
skin?: string
page?: Object
defaultToolbar?: Boolean
}>()
const emit = defineEmits(['change'])