auto-vue-manual 0.0.21 → 0.0.24

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.
package/README.md CHANGED
@@ -15,6 +15,7 @@
15
15
  | **search** | `{ defaultValue }` | 搜索项配置, defaultValue可以设置默认的init-param | - |
16
16
  | **headerRender** | `(scope: HeaderRenderScope<T>) => VNode` | 自定义表头内容渲染(tsx语法) | - |
17
17
  | **render** | `(scope: RenderScope<T>) => VNode string` | 自定义单元格内容渲染(tsx语法),Basic和list的scope略有不同,请注意 | - |
18
+ | **props** | `{ api?: string, activeValue?: any, inactiveValue?: any, refresh?: boolean }` | type = switch 时,props 配置 (TODO 更新其他type) | - |
18
19
 
19
20
  ### Props 参数说明
20
21
 
@@ -43,8 +44,9 @@
43
44
 
44
45
  | 事件名 | 说明 | 参数 |
45
46
  | ------ | ---- | ---- |
46
- | **@row-click** | 行点击事件,已排除 status / operation 列 | `({ row: any, column: any }) => void` |
47
- | **@row-dblclick** | 行双击事件,已排除 status / operation 列 | `({ row: any, column: any }) => void` |
47
+ | **@row-click** | 行点击事件,已排除 status / operation 列 | `(row: any, column: any) => void` |
48
+ | **@row-dblclick** | 行双击事件,已排除 status / operation 列 | `(row: any, column: any) => void` |
49
+ | **@switch-change** | 开关切换事件 | `(value, scope, column) => void` |
48
50
 
49
51
  ### Expose 暴露方法说明
50
52
 
@@ -84,10 +86,12 @@ import { ProTable } from "auto-vue-manual";
84
86
 
85
87
  const proTableRef = ref<InstanceType<typeof ProTable>>();
86
88
  const columns: ColumnProps[] = [
87
- { prop: "code", label: "代号", width: 100 },
89
+ { label: "index", type: 'index' },
90
+ { prop: "code", label: "代号", width: 100, type: 'tag' },
88
91
  { prop: "logo", label: "标志", width: 100 },
89
- { prop: "status", label: "状态", width: 100, search: { defaultValue: 1 } },
92
+ { prop: "status", label: "状态", width: 100, type: 'switch', props: { activeValue: 1, inactiveValue: 2, api: '/league/change_status', refresh: true } },
90
93
  { prop: "name", label: "名称", width: 0, align: "right",
94
+ search: { defaultValue: "League" },
91
95
  headerRender: ({ column }: HeaderRenderScope<any>) => {
92
96
  return (<span>headerRender: {column.label}</span>)
93
97
  },
@@ -153,16 +157,16 @@ import ProTableList from "auto-vue-manual";
153
157
 
154
158
  const proTableRef = ref<InstanceType<typeof ProTableList>>();
155
159
  const columns: ColumnProps[] = [
156
- { prop: "label", label: "Label", width: 100 },
157
- { prop: "key", label: "Key", width: 100 },
160
+ { label: "index", type: 'index' },
161
+ { prop: "label", label: "Label", width: 100, type: 'tag' },
162
+ { prop: "key", label: "Key", width: 100, type: 'copy' },
158
163
  { prop: "value", label: "Value", width: 200, headerRender: (scope: HeaderRenderScope<any>) => {
159
- console.log('headerRender', scope)
160
164
  return (
161
165
  <span>HeaderRender: {scope.column.label}</span>
162
166
  )
163
167
  }},
168
+ { prop: "status", label: "Status", width: 100, type: 'switch', props: { activeValue: 1, inactiveValue: 2, api: '/league/change_status', refresh: true } },
164
169
  { prop: "action", label: "Action", width: 60, align: "center", render: (scope: RenderScope<any>) => {
165
- console.log('render', scope)
166
170
  return (
167
171
  <el-button type="primary" size="small" link icon={Plus} onClick={(e: Event) => {
168
172
  e.stopPropagation();