mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 18:28:43 +08:00 
			
		
		
		
	perf: top action slost
This commit is contained in:
		| @@ -18,7 +18,7 @@ export type VxeCrudSchema = { | ||||
|   primaryKey?: string // 主键ID | ||||
|   primaryTitle?: string // 主键标题 默认为序号 | ||||
|   primaryType?: VxeColumnPropTypes.Type // 不填写为数据库编号 null为不显示 还支持 "seq" | "radio" | "checkbox" | "expand" | "html" | null | ||||
|   action?: boolean // 是否开启操作栏插槽 | ||||
|   action?: boolean // 是否开启表格内右侧操作栏插槽 | ||||
|   actionTitle?: string // 操作栏标题 默认为操作 | ||||
|   actionWidth?: string // 操作栏插槽宽度,一般2个字带图标 text 类型按钮 50-70 | ||||
|   columns: VxeCrudColumns[] | ||||
|   | ||||
| @@ -11,6 +11,7 @@ const message = useMessage() // 消息弹窗 | ||||
|  | ||||
| interface UseVxeGridConfig<T = any> { | ||||
|   allSchemas: VxeAllSchemas | ||||
|   topActionSlots?: boolean // 是否开启表格内顶部操作栏插槽 | ||||
|   treeConfig?: VxeTablePropTypes.TreeConfig | ||||
|   getListApi: (option: any) => Promise<T> | ||||
|   deleteApi?: (option: any) => Promise<T> | ||||
| @@ -51,7 +52,10 @@ export const useVxeGrid = <T = any>(config?: UseVxeGridConfig<T>) => { | ||||
|       isHover: true // 当鼠标移到行时,是否要高亮当前行 | ||||
|     }, | ||||
|     toolbarConfig: { | ||||
|       slots: { buttons: 'toolbar_buttons' } | ||||
|       slots: | ||||
|         !config?.topActionSlots && config?.topActionSlots != false | ||||
|           ? { buttons: 'toolbar_buttons' } | ||||
|           : {} | ||||
|     }, | ||||
|     printConfig: { | ||||
|       columns: config?.allSchemas.printSchema | ||||
|   | ||||
| @@ -41,6 +41,7 @@ const message = useMessage() // 消息弹窗 | ||||
| const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref | ||||
| const { gridOptions, getList } = useVxeGrid<TokenApi.OAuth2TokenVO>({ | ||||
|   allSchemas: allSchemas, | ||||
|   topActionSlots: false, | ||||
|   getListApi: TokenApi.getAccessTokenPageApi | ||||
| }) | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 xingyu4j
					xingyu4j