From ceae92fe7cb552902d070e61333fd86c510ff191 Mon Sep 17 00:00:00 2001 From: zazzaz Date: Tue, 20 Oct 2020 11:47:02 +0800 Subject: [PATCH] fix: fix table tooltip (#438) --- .gitignore | 2 +- packages/table/doc/basic.vue | 46 --------- packages/table/doc/border.vue | 70 ------------- packages/table/doc/diyHeader.vue | 58 ----------- packages/table/doc/diyIndex.vue | 60 ----------- packages/table/doc/diyTemplate.vue | 81 --------------- packages/table/doc/expandRow.vue | 108 -------------------- packages/table/doc/filter.vue | 89 ---------------- packages/table/doc/fixedCol.vue | 71 ------------- packages/table/doc/fixedColRow.vue | 85 ---------------- packages/table/doc/fixedHeader.vue | 95 ----------------- packages/table/doc/footerCount.vue | 104 ------------------- packages/table/doc/index.stories.ts | 24 ----- packages/table/doc/maxHeight.vue | 94 ----------------- packages/table/doc/mergeRowCol.vue | 103 ------------------- packages/table/doc/mulCheck.vue | 90 ----------------- packages/table/doc/mulHeader.vue | 82 --------------- packages/table/doc/rowClassName.vue | 61 ----------- packages/table/doc/singleSelect.vue | 62 ------------ packages/table/doc/sort.vue | 68 ------------- packages/table/doc/stripe.vue | 60 ----------- packages/table/doc/treeTable.vue | 135 ------------------------- packages/table/src/table-body/index.ts | 40 ++++---- website/play/.gitkeep | 0 website/play/index.vue | 13 --- 25 files changed, 21 insertions(+), 1680 deletions(-) delete mode 100644 packages/table/doc/basic.vue delete mode 100644 packages/table/doc/border.vue delete mode 100644 packages/table/doc/diyHeader.vue delete mode 100644 packages/table/doc/diyIndex.vue delete mode 100644 packages/table/doc/diyTemplate.vue delete mode 100644 packages/table/doc/expandRow.vue delete mode 100644 packages/table/doc/filter.vue delete mode 100644 packages/table/doc/fixedCol.vue delete mode 100644 packages/table/doc/fixedColRow.vue delete mode 100644 packages/table/doc/fixedHeader.vue delete mode 100644 packages/table/doc/footerCount.vue delete mode 100644 packages/table/doc/index.stories.ts delete mode 100644 packages/table/doc/maxHeight.vue delete mode 100644 packages/table/doc/mergeRowCol.vue delete mode 100644 packages/table/doc/mulCheck.vue delete mode 100644 packages/table/doc/mulHeader.vue delete mode 100644 packages/table/doc/rowClassName.vue delete mode 100644 packages/table/doc/singleSelect.vue delete mode 100644 packages/table/doc/sort.vue delete mode 100644 packages/table/doc/stripe.vue delete mode 100644 packages/table/doc/treeTable.vue create mode 100644 website/play/.gitkeep delete mode 100644 website/play/index.vue diff --git a/.gitignore b/.gitignore index 89dea5a88d..4b1dbd80cc 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,4 @@ storybook-static coverage/ website-dist lib -website/play/ +website/play/index.vue diff --git a/packages/table/doc/basic.vue b/packages/table/doc/basic.vue deleted file mode 100644 index b4946e9725..0000000000 --- a/packages/table/doc/basic.vue +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - diff --git a/packages/table/doc/border.vue b/packages/table/doc/border.vue deleted file mode 100644 index 3ac367f8ed..0000000000 --- a/packages/table/doc/border.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - diff --git a/packages/table/doc/diyHeader.vue b/packages/table/doc/diyHeader.vue deleted file mode 100644 index 5f9eafd0c6..0000000000 --- a/packages/table/doc/diyHeader.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - diff --git a/packages/table/doc/diyIndex.vue b/packages/table/doc/diyIndex.vue deleted file mode 100644 index 50d8ff3d83..0000000000 --- a/packages/table/doc/diyIndex.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - diff --git a/packages/table/doc/diyTemplate.vue b/packages/table/doc/diyTemplate.vue deleted file mode 100644 index 48c5c8fbc8..0000000000 --- a/packages/table/doc/diyTemplate.vue +++ /dev/null @@ -1,81 +0,0 @@ - - - - - diff --git a/packages/table/doc/expandRow.vue b/packages/table/doc/expandRow.vue deleted file mode 100644 index be4a6121b5..0000000000 --- a/packages/table/doc/expandRow.vue +++ /dev/null @@ -1,108 +0,0 @@ - - - - - diff --git a/packages/table/doc/filter.vue b/packages/table/doc/filter.vue deleted file mode 100644 index 0c425f50b7..0000000000 --- a/packages/table/doc/filter.vue +++ /dev/null @@ -1,89 +0,0 @@ - - - diff --git a/packages/table/doc/fixedCol.vue b/packages/table/doc/fixedCol.vue deleted file mode 100644 index 001b0140e6..0000000000 --- a/packages/table/doc/fixedCol.vue +++ /dev/null @@ -1,71 +0,0 @@ - - - diff --git a/packages/table/doc/fixedColRow.vue b/packages/table/doc/fixedColRow.vue deleted file mode 100644 index 08fe126a61..0000000000 --- a/packages/table/doc/fixedColRow.vue +++ /dev/null @@ -1,85 +0,0 @@ - - - diff --git a/packages/table/doc/fixedHeader.vue b/packages/table/doc/fixedHeader.vue deleted file mode 100644 index 4e77acf01b..0000000000 --- a/packages/table/doc/fixedHeader.vue +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - diff --git a/packages/table/doc/footerCount.vue b/packages/table/doc/footerCount.vue deleted file mode 100644 index 32bc4a3846..0000000000 --- a/packages/table/doc/footerCount.vue +++ /dev/null @@ -1,104 +0,0 @@ - - - diff --git a/packages/table/doc/index.stories.ts b/packages/table/doc/index.stories.ts deleted file mode 100644 index cdf6715202..0000000000 --- a/packages/table/doc/index.stories.ts +++ /dev/null @@ -1,24 +0,0 @@ -export { default as BasicUsage } from './basic.vue' -export { default as Border } from './border.vue' -export { default as Stripe } from './stripe.vue' -export { default as RowClassName } from './rowClassName.vue' -export { default as FixHeader } from './fixedHeader.vue' -export { default as FixCol } from './fixedCol.vue' -export { default as FixColRow } from './fixedColRow.vue' -export { default as MaxHeight } from './maxHeight.vue' -export { default as MulHeader } from './mulHeader.vue' -export { default as SingleSelect } from './singleSelect.vue' -export { default as MulCheck } from './mulCheck.vue' -export { default as Sort } from './sort.vue' -export { default as Filter } from './filter.vue' -export { default as DiyTemplate } from './diyTemplate.vue' -export { default as ExpandRow } from './expandRow.vue' -export { default as TreeTable } from './treeTable.vue' -export { default as DiyHeader } from './diyHeader.vue' -export { default as FooterCount } from './footerCount.vue' -export { default as MergeRowCol } from './mergeRowCol.vue' -export { default as DiyIndex } from './diyIndex.vue' - -export default { - title: 'Table', -} diff --git a/packages/table/doc/maxHeight.vue b/packages/table/doc/maxHeight.vue deleted file mode 100644 index e85eecc8f8..0000000000 --- a/packages/table/doc/maxHeight.vue +++ /dev/null @@ -1,94 +0,0 @@ - - - diff --git a/packages/table/doc/mergeRowCol.vue b/packages/table/doc/mergeRowCol.vue deleted file mode 100644 index 11b0de17ab..0000000000 --- a/packages/table/doc/mergeRowCol.vue +++ /dev/null @@ -1,103 +0,0 @@ - - - diff --git a/packages/table/doc/mulCheck.vue b/packages/table/doc/mulCheck.vue deleted file mode 100644 index 9fd164123c..0000000000 --- a/packages/table/doc/mulCheck.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - diff --git a/packages/table/doc/mulHeader.vue b/packages/table/doc/mulHeader.vue deleted file mode 100644 index 966ea9fafe..0000000000 --- a/packages/table/doc/mulHeader.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - diff --git a/packages/table/doc/rowClassName.vue b/packages/table/doc/rowClassName.vue deleted file mode 100644 index 9ebeae32bc..0000000000 --- a/packages/table/doc/rowClassName.vue +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - diff --git a/packages/table/doc/singleSelect.vue b/packages/table/doc/singleSelect.vue deleted file mode 100644 index b0ea72c0f4..0000000000 --- a/packages/table/doc/singleSelect.vue +++ /dev/null @@ -1,62 +0,0 @@ - - - diff --git a/packages/table/doc/sort.vue b/packages/table/doc/sort.vue deleted file mode 100644 index 41541e99d8..0000000000 --- a/packages/table/doc/sort.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - diff --git a/packages/table/doc/stripe.vue b/packages/table/doc/stripe.vue deleted file mode 100644 index 6f79c2ff07..0000000000 --- a/packages/table/doc/stripe.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - diff --git a/packages/table/doc/treeTable.vue b/packages/table/doc/treeTable.vue deleted file mode 100644 index cd8704a4f5..0000000000 --- a/packages/table/doc/treeTable.vue +++ /dev/null @@ -1,135 +0,0 @@ - - diff --git a/packages/table/src/table-body/index.ts b/packages/table/src/table-body/index.ts index 190d1b2e7c..dca0c3e5df 100644 --- a/packages/table/src/table-body/index.ts +++ b/packages/table/src/table-body/index.ts @@ -1,12 +1,12 @@ -import { defineComponent, getCurrentInstance, h, watch, PropType } from 'vue' -import useLayoutObserver from '../layout-observer' -import { removeClass, addClass } from '@element-plus/utils/dom' +import ElTooltip from '@element-plus/tooltip/src/index' +import { addClass, removeClass } from '@element-plus/utils/dom' import isServer from '@element-plus/utils/isServer' -// import ElTooltip from '@element-plus/tooltip/src/index' -import { Table, Store } from '../table' -import { TableBodyProps } from './table-body' -import useRender from './render-helper' +import { defineComponent, getCurrentInstance, h, PropType, watch } from 'vue' import { hColgroup } from '../h-helper' +import useLayoutObserver from '../layout-observer' +import { Store, Table } from '../table' +import useRender from './render-helper' +import { TableBodyProps } from './table-body' export default defineComponent({ name: 'ElTableBody', props: { @@ -86,19 +86,19 @@ export default defineComponent({ data.reduce((acc, row) => { return acc.concat(this.wrappedRowRender(row, acc.length)) }, []), - // h( - // ElTooltip, - // { - // modelValue: this.tooltipVisible, - // content: this.tooltipContent, - // manual: true, - // effect: this.$parent.tooltipEffect, - // placement: 'top', - // }, - // { - // default: () => this.tooltipTrigger, - // }, - // ), + h( + ElTooltip, + { + modelValue: this.tooltipVisible, + content: this.tooltipContent, + manual: true, + effect: this.$parent.tooltipEffect, + placement: 'top', + }, + { + default: () => this.tooltipTrigger, + }, + ), ]), ], ) diff --git a/website/play/.gitkeep b/website/play/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/website/play/index.vue b/website/play/index.vue deleted file mode 100644 index 0135a917b6..0000000000 --- a/website/play/index.vue +++ /dev/null @@ -1,13 +0,0 @@ - - -