rayyy-vue-table-components 2.0.45 → 2.0.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,6 +15,7 @@ declare const _default: <T extends Record<string, unknown> = Record<string, unkn
15
15
  data: T[];
16
16
  columns: TableColumn<T>[];
17
17
  showSelection?: boolean;
18
+ showIndex?: boolean;
18
19
  showSummary?: boolean;
19
20
  showOverFlowTooltip?: boolean;
20
21
  summaryMethod?: ((param: {
@@ -15,6 +15,7 @@ declare const _default: <T extends Record<string, unknown>>(__VLS_props: NonNull
15
15
  columns: TableColumn<T>[];
16
16
  tableTitle?: string;
17
17
  showSelection?: boolean;
18
+ showIndex?: boolean;
18
19
  loading?: boolean;
19
20
  showSummary?: boolean;
20
21
  showOverFlowTooltip?: boolean;
@@ -15,6 +15,7 @@ declare const _default: <T extends Record<string, unknown>>(__VLS_props: NonNull
15
15
  tableTitle?: string;
16
16
  propIsEditable?: boolean;
17
17
  showSelection?: boolean;
18
+ showIndex?: boolean;
18
19
  onlyDelete?: boolean;
19
20
  showDelete?: boolean;
20
21
  loading?: boolean;
@@ -15,6 +15,8 @@ export interface BaseTableProps<T extends Record<string, unknown> = Record<strin
15
15
  columns: TableColumn<T>[]
16
16
  /** 是否顯示選擇列 */
17
17
  showSelection?: boolean
18
+ /** 是否顯示索引列 */
19
+ showIndex?: boolean
18
20
  /** 是否顯示匯總行 */
19
21
  showSummary?: boolean
20
22
  /** 是否顯示溢出提示 */
@@ -68,6 +70,8 @@ export interface SortTableProps<T extends Record<string, unknown> = Record<strin
68
70
  tableTitle?: string
69
71
  /** 是否顯示選擇列 */
70
72
  showSelection?: boolean
73
+ /** 是否顯示索引列 */
74
+ showIndex?: boolean
71
75
  /** 是否顯示加載狀態 */
72
76
  loading?: boolean
73
77
  /** 是否顯示匯總行 */
@@ -127,6 +131,8 @@ export interface TitleTableProps<T extends Record<string, unknown> = Record<stri
127
131
  propIsEditable?: boolean
128
132
  /** 是否顯示選擇列 */
129
133
  showSelection?: boolean
134
+ /** 是否顯示索引列 */
135
+ showIndex?: boolean
130
136
  /** 是否只顯示刪除按鈕(隱藏新增按鈕) */
131
137
  onlyDelete?: boolean
132
138
  /** 是否顯示刪除按鈕 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rayyy-vue-table-components",
3
- "version": "2.0.45",
3
+ "version": "2.0.47",
4
4
  "description": "Vue 3 + Element Plus 表格組件庫",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.js",
@@ -33,7 +33,7 @@ $colors: (
33
33
  --main-color-light-8: #b3def0;
34
34
  --main-color-light-9: #ccedf7;
35
35
  --main-color-dark-2: #005b96;
36
- --main-color-border: #606266;
36
+ --main-color-border: #c5c8cc;
37
37
 
38
38
  // 成功色系
39
39
  --el-color-success: #67c23a;
@@ -13,6 +13,7 @@ type Props<T extends Record<string, unknown> = Record<string, unknown>> = {
13
13
  data: T[]
14
14
  columns: TableColumn<T>[]
15
15
  showSelection?: boolean
16
+ showIndex?: boolean
16
17
  showSummary?: boolean
17
18
  showOverFlowTooltip?: boolean
18
19
  summaryMethod?: (param: {
@@ -30,6 +31,7 @@ const props = withDefaults(defineProps<Props<T>>(), {
30
31
  loading: false,
31
32
  data: () => [],
32
33
  showSelection: false,
34
+ showIndex: false,
33
35
  showSummary: false,
34
36
  showOverFlowTooltip: false,
35
37
  showCheckBtn: false,
@@ -101,6 +103,9 @@ const operatorWidth = computed(() => {
101
103
  <!-- 選擇列 -->
102
104
  <el-table-column v-if="showSelection" type="selection" width="60" fixed="left" align="center" />
103
105
 
106
+ <!-- 索引列 -->
107
+ <el-table-column v-if="showIndex" type="index" width="60" fixed="left" align="center" label="No" />
108
+
104
109
  <!-- 數據列 -->
105
110
  <el-table-column v-for="(column, index) in columns" :key="index" v-bind="column">
106
111
  <template #default="{ row }">
@@ -10,6 +10,7 @@ defineProps<{
10
10
  columns: TableColumn<T>[]
11
11
  tableTitle?: string
12
12
  showSelection?: boolean
13
+ showIndex?: boolean
13
14
  loading?: boolean
14
15
  showSummary?: boolean
15
16
  showOverFlowTooltip?: boolean
@@ -106,6 +107,7 @@ const state = reactive({
106
107
  :show-over-flow-tooltip="showOverFlowTooltip"
107
108
  :summary-method="summaryMethod"
108
109
  :show-selection="showSelection"
110
+ :show-index="showIndex"
109
111
  :base-table-row-class-name="sortTableRowClassName"
110
112
  :show-check-btn="showCheckBtn"
111
113
  :show-edit-btn="showEditBtn"
@@ -14,6 +14,7 @@ defineProps<{
14
14
  tableTitle?: string
15
15
  propIsEditable?: boolean
16
16
  showSelection?: boolean
17
+ showIndex?: boolean
17
18
  onlyDelete?: boolean
18
19
  showDelete?: boolean
19
20
  loading?: boolean
@@ -96,6 +97,7 @@ const handleEditClick = (row: T) => {
96
97
  :show-summary="showSummary"
97
98
  :summary-method="summaryMethod"
98
99
  :show-selection="propIsEditable || showSelection"
100
+ :show-index="showIndex"
99
101
  :show-over-flow-tooltip="showOverFlowTooltip"
100
102
  :show-check-btn="showCheckBtn"
101
103
  :show-edit-btn="showEditBtn"
@@ -16,6 +16,8 @@ export interface BaseTableProps<T extends Record<string, unknown> = Record<strin
16
16
  columns: TableColumn<T>[]
17
17
  /** 是否顯示選擇列 */
18
18
  showSelection?: boolean
19
+ /** 是否顯示索引列 */
20
+ showIndex?: boolean
19
21
  /** 是否顯示匯總行 */
20
22
  showSummary?: boolean
21
23
  /** 是否顯示溢出提示 */
@@ -69,6 +71,8 @@ export interface SortTableProps<T extends Record<string, unknown> = Record<strin
69
71
  tableTitle?: string
70
72
  /** 是否顯示選擇列 */
71
73
  showSelection?: boolean
74
+ /** 是否顯示索引列 */
75
+ showIndex?: boolean
72
76
  /** 是否顯示加載狀態 */
73
77
  loading?: boolean
74
78
  /** 是否顯示匯總行 */
@@ -128,6 +132,8 @@ export interface TitleTableProps<T extends Record<string, unknown> = Record<stri
128
132
  propIsEditable?: boolean
129
133
  /** 是否顯示選擇列 */
130
134
  showSelection?: boolean
135
+ /** 是否顯示索引列 */
136
+ showIndex?: boolean
131
137
  /** 是否只顯示刪除按鈕(隱藏新增按鈕) */
132
138
  onlyDelete?: boolean
133
139
  /** 是否顯示刪除按鈕 */