feat(table): 新增 defaultToolbar 属性, 用于开启默认工具栏
This commit is contained in:
parent
223e377085
commit
94b37a19f9
@ -126,7 +126,7 @@ export default {
|
|||||||
::: demo
|
::: demo
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<lay-table :columns="columns" :dataSource="dataSource">
|
<lay-table :columns="columns" :dataSource="dataSource" default-toolbar="true">
|
||||||
<template v-slot:toolbar>
|
<template v-slot:toolbar>
|
||||||
<lay-button>新增</lay-button>
|
<lay-button>新增</lay-button>
|
||||||
<lay-button>删除</lay-button>
|
<lay-button>删除</lay-button>
|
||||||
|
@ -4,13 +4,13 @@
|
|||||||
<div
|
<div
|
||||||
class="layui-form layui-border-box layui-table-view layui-table-view-1"
|
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-table-tool-temp">
|
||||||
<div class="layui-btn-container">
|
<div class="layui-btn-container">
|
||||||
<slot name="toolbar"></slot>
|
<slot name="toolbar"></slot>
|
||||||
</div>
|
</div>
|
||||||
</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">
|
<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>
|
||||||
@ -133,6 +133,7 @@ const props =
|
|||||||
dataSource?: Object[]
|
dataSource?: Object[]
|
||||||
skin?: string
|
skin?: string
|
||||||
page?: Object
|
page?: Object
|
||||||
|
defaultToolbar?: Boolean
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const emit = defineEmits(['change'])
|
const emit = defineEmits(['change'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user