rayyy-vue-table-components 1.3.13 → 1.3.15

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.
@@ -24,7 +24,8 @@ declare const _default: <T extends Record<string, unknown> = Record<string, unkn
24
24
  row: T;
25
25
  rowIndex: number;
26
26
  }) => string) | undefined;
27
- showOperator?: boolean;
27
+ showCheckBtn?: boolean;
28
+ showEditBtn?: boolean;
28
29
  } & Partial<{}>> & import('vue').PublicProps;
29
30
  expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
30
31
  attrs: any;
@@ -25,7 +25,8 @@ declare const _default: <T extends Record<string, unknown>>(__VLS_props: NonNull
25
25
  row: T;
26
26
  rowIndex: number;
27
27
  }) => string;
28
- showOperator?: boolean;
28
+ showCheckBtn?: boolean;
29
+ showEditBtn?: boolean;
29
30
  } & Partial<{}>> & import('vue').PublicProps;
30
31
  expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
31
32
  attrs: any;
@@ -24,7 +24,8 @@ declare const _default: <T extends Record<string, unknown>>(__VLS_props: NonNull
24
24
  columns: TableColumnCtx<Record<string, unknown>>[];
25
25
  data: T[];
26
26
  }) => (string | VNode)[];
27
- showOperator?: boolean;
27
+ showCheckBtn?: boolean;
28
+ showEditBtn?: boolean;
28
29
  } & Partial<{}>> & import('vue').PublicProps;
29
30
  expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
30
31
  attrs: any;
@@ -26,8 +26,10 @@ export interface BaseTableProps<T extends Record<string, unknown> = Record<strin
26
26
  }) => (string | VNode)[]
27
27
  /** 行樣式類名 */
28
28
  baseTableRowClassName?: (data: { row: T; rowIndex: number }) => string
29
- /** 是否顯示操作列 */
30
- showOperator?: boolean
29
+ /** 是否顯示查看按鈕 */
30
+ showCheckBtn?: boolean
31
+ /** 是否顯示編輯按鈕 */
32
+ showEditBtn?: boolean
31
33
  }
32
34
 
33
35
  /** BaseTable 組件 Emits 類型 */
@@ -79,8 +81,10 @@ export interface SortTableProps<T extends Record<string, unknown> = Record<strin
79
81
  }) => (string | import('vue').VNode)[]
80
82
  /** 行樣式類名 */
81
83
  sortTableRowClassName?: (data: { row: T; rowIndex: number }) => string
82
- /** 是否顯示操作列 */
83
- showOperator?: boolean
84
+ /** 是否顯示查看按鈕 */
85
+ showCheckBtn?: boolean
86
+ /** 是否顯示編輯按鈕 */
87
+ showEditBtn?: boolean
84
88
  }
85
89
 
86
90
  /** SortTable 組件 Emits 類型 */
@@ -136,8 +140,10 @@ export interface TitleTableProps<T extends Record<string, unknown> = Record<stri
136
140
  columns: import('element-plus').TableColumnCtx<Record<string, unknown>>[]
137
141
  data: T[]
138
142
  }) => (string | import('vue').VNode)[]
139
- /** 是否顯示操作列 */
140
- showOperator?: boolean
143
+ /** 是否顯示查看按鈕 */
144
+ showCheckBtn?: boolean
145
+ /** 是否顯示編輯按鈕 */
146
+ showEditBtn?: boolean
141
147
  }
142
148
 
143
149
  /** TitleTable 組件 Emits 類型 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rayyy-vue-table-components",
3
- "version": "1.3.13",
3
+ "version": "1.3.15",
4
4
  "description": "Vue 3 + Element Plus 表格組件庫",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.js",
@@ -15,7 +15,8 @@ type Props<T extends Record<string, unknown> = Record<string, unknown>> = {
15
15
  data: T[]
16
16
  }) => (string | VNode)[]
17
17
  baseTableRowClassName?: (data: { row: T; rowIndex: number }) => string
18
- showOperator?: boolean
18
+ showCheckBtn?: boolean
19
+ showEditBtn?: boolean
19
20
  }
20
21
 
21
22
  // 組件屬性默認值
@@ -25,7 +26,8 @@ const props = withDefaults(defineProps<Props<T>>(), {
25
26
  showSelection: false,
26
27
  showSummary: false,
27
28
  showOverFlowTooltip: false,
28
- showOperator: false,
29
+ showCheckBtn: false,
30
+ showEditBtn: false,
29
31
  summaryMethod: () => [],
30
32
  baseTableRowClassName: () => '',
31
33
  })
@@ -102,24 +104,29 @@ const handleOperateClick = (value: T, clickType: 'check' | 'edit') => {
102
104
  </div>
103
105
  </template>
104
106
  </el-table-column>
105
- <el-table-column v-if="showOperator" width="120" align="center" fixed="right">
107
+ <el-table-column
108
+ v-if="props.showCheckBtn || props.showEditBtn"
109
+ width="120"
110
+ align="center"
111
+ fixed="right"
112
+ >
106
113
  <template #default="{ row }">
107
114
  <div class="flex items-center justify-center">
108
- <base-btn
109
- type="primary"
110
- :text-btn="true"
111
- size="small"
112
- text="查看"
115
+ <p
116
+ class="blue-text cursor-pointer font-bold"
113
117
  @click="handleOperateClick(row, 'check')"
114
- />
115
- <el-divider direction="vertical" class="!mx-1" />
116
- <base-btn
117
- type="primary"
118
- :text-btn="true"
119
- size="small"
120
- text="编辑"
118
+ v-if="showCheckBtn"
119
+ >
120
+ 查看
121
+ </p>
122
+ <el-divider direction="vertical" class="!mx-2" v-if="showCheckBtn && showEditBtn" />
123
+ <p
124
+ class="blue-text cursor-pointer font-bold"
121
125
  @click="handleOperateClick(row, 'edit')"
122
- />
126
+ v-if="showEditBtn"
127
+ >
128
+ 编辑
129
+ </p>
123
130
  </div>
124
131
  </template>
125
132
  </el-table-column>
@@ -18,7 +18,8 @@ defineProps<{
18
18
  data: T[]
19
19
  }) => (string | VNode)[]
20
20
  sortTableRowClassName?: (data: { row: T; rowIndex: number }) => string
21
- showOperator?: boolean
21
+ showCheckBtn?: boolean
22
+ showEditBtn?: boolean
22
23
  }>()
23
24
 
24
25
  const emit = defineEmits<{
@@ -77,7 +78,8 @@ const handleEditClick = (row: T) => {
77
78
  :summary-method="summaryMethod"
78
79
  :show-selection="showSelection"
79
80
  :base-table-row-class-name="sortTableRowClassName"
80
- :show-operator="showOperator"
81
+ :show-check-btn="showCheckBtn"
82
+ :show-edit-btn="showEditBtn"
81
83
  @selection-change="handleSelectionChange"
82
84
  @cell-click="handleCellClick"
83
85
  @column-sort-change="handleColumnSortChange"
@@ -20,7 +20,8 @@ defineProps<{
20
20
  columns: TableColumnCtx<Record<string, unknown>>[]
21
21
  data: T[]
22
22
  }) => (string | VNode)[]
23
- showOperator?: boolean
23
+ showCheckBtn?: boolean
24
+ showEditBtn?: boolean
24
25
  }>()
25
26
 
26
27
  const emit = defineEmits<{
@@ -83,7 +84,8 @@ const handleEditClick = (row: T) => {
83
84
  :summary-method="summaryMethod"
84
85
  :show-selection="propIsEditable || showSelection"
85
86
  :show-over-flow-tooltip="showOverFlowTooltip"
86
- :show-operator="showOperator"
87
+ :show-check-btn="showCheckBtn"
88
+ :show-edit-btn="showEditBtn"
87
89
  @selection-change="handleSelectionChange"
88
90
  @cell-click="handleCellClick"
89
91
  @click:checkRow="handleCheckClick"
@@ -27,8 +27,10 @@ export interface BaseTableProps<T extends Record<string, unknown> = Record<strin
27
27
  }) => (string | VNode)[]
28
28
  /** 行樣式類名 */
29
29
  baseTableRowClassName?: (data: { row: T; rowIndex: number }) => string
30
- /** 是否顯示操作列 */
31
- showOperator?: boolean
30
+ /** 是否顯示查看按鈕 */
31
+ showCheckBtn?: boolean
32
+ /** 是否顯示編輯按鈕 */
33
+ showEditBtn?: boolean
32
34
  }
33
35
 
34
36
  /** BaseTable 組件 Emits 類型 */
@@ -80,8 +82,10 @@ export interface SortTableProps<T extends Record<string, unknown> = Record<strin
80
82
  }) => (string | import('vue').VNode)[]
81
83
  /** 行樣式類名 */
82
84
  sortTableRowClassName?: (data: { row: T; rowIndex: number }) => string
83
- /** 是否顯示操作列 */
84
- showOperator?: boolean
85
+ /** 是否顯示查看按鈕 */
86
+ showCheckBtn?: boolean
87
+ /** 是否顯示編輯按鈕 */
88
+ showEditBtn?: boolean
85
89
  }
86
90
 
87
91
  /** SortTable 組件 Emits 類型 */
@@ -137,8 +141,10 @@ export interface TitleTableProps<T extends Record<string, unknown> = Record<stri
137
141
  columns: import('element-plus').TableColumnCtx<Record<string, unknown>>[]
138
142
  data: T[]
139
143
  }) => (string | import('vue').VNode)[]
140
- /** 是否顯示操作列 */
141
- showOperator?: boolean
144
+ /** 是否顯示查看按鈕 */
145
+ showCheckBtn?: boolean
146
+ /** 是否顯示編輯按鈕 */
147
+ showEditBtn?: boolean
142
148
  }
143
149
 
144
150
  /** TitleTable 組件 Emits 類型 */