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 = {