From 3cf3ed0fc6c7f34993003a060ed1d6c26b141ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E5=84=80=E5=BC=8F?= <854085467@qq.com> Date: Sun, 20 Nov 2022 23:52:15 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(table):=20=E4=BC=98=E5=8C=96=20defaul?= =?UTF-8?q?t-toolbar=20=E6=A0=B9=E6=8D=AE=E8=AE=BE=E7=BD=AE=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/component/src/component/table/index.less | 5 +++++ package/component/src/component/table/index.vue | 12 +++++++++++- .../src/document/zh-CN/components/table.md | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/package/component/src/component/table/index.less b/package/component/src/component/table/index.less index 010d1609..f205795c 100644 --- a/package/component/src/component/table/index.less +++ b/package/component/src/component/table/index.less @@ -305,6 +305,11 @@ right: -1px; } +.layui-table-tool-self { + display: flex; + align-items: center; +} + .layui-table-col-set { position: absolute; right: 0; diff --git a/package/component/src/component/table/index.vue b/package/component/src/component/table/index.vue index d4b8209b..3fb5ce4b 100644 --- a/package/component/src/component/table/index.vue +++ b/package/component/src/component/table/index.vue @@ -682,6 +682,12 @@ const showToolbar = (toolbarName: string) => { return props.defaultToolbar; }; +const toolbarStyle = (toolbarName: string) => { + if (props.defaultToolbar instanceof Array) { + return { order: props.defaultToolbar.indexOf(toolbarName) } as StyleValue; + } +} + onBeforeUnmount(() => { window.onresize = null; }); @@ -696,8 +702,9 @@ onBeforeUnmount(() => {
+ - +
@@ -722,6 +729,7 @@ onBeforeUnmount(() => { class="layui-inline" title="导出" lay-event + :style="toolbarStyle('export')" @click="exportData()" > @@ -730,6 +738,7 @@ onBeforeUnmount(() => {
{ >
+
diff --git a/package/document-component/src/document/zh-CN/components/table.md b/package/document-component/src/document/zh-CN/components/table.md index 149d2103..2c65c4f7 100644 --- a/package/document-component/src/document/zh-CN/components/table.md +++ b/package/document-component/src/document/zh-CN/components/table.md @@ -1430,7 +1430,7 @@ export default { const selectedKeys5 = ref(['1']) const checkbox5 = ref(true) - const defaultToolbar5 = ref(['print']) + const defaultToolbar5 = ref(['export','print']) const maxHeight5 = ref('600px'); const page5 = {