mirror of
https://github.com/certd/certd.git
synced 2026-08-05 05:05:53 +08:00
🔱: [client] sync upgrade with 6 commits [trident-sync]
chore: perf: v-model editable-row示例 chore: mock tip fix: 修复行编辑模式下,render、conditionalRender无效的bug fix: 修复行编辑初始化无效的bug
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import * as api from "./api";
|
||||
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||
export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
return await api.GetList(query);
|
||||
@@ -24,6 +24,7 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
|
||||
editRequest,
|
||||
delRequest
|
||||
},
|
||||
//将 addRow 按钮启用
|
||||
actionbar: { buttons: { add: { show: false }, addRow: { show: true } } },
|
||||
table: {
|
||||
editable: {
|
||||
@@ -61,6 +62,24 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
|
||||
url: "/mock/dicts/OpenStatusEnum?single"
|
||||
})
|
||||
},
|
||||
target: {
|
||||
title: "根据状态动态显隐",
|
||||
search: { show: true },
|
||||
type: "text",
|
||||
form: {
|
||||
conditionalRender: {
|
||||
match: ({ form }) => {
|
||||
return form.radio === "2";
|
||||
},
|
||||
render: ({ form }) => {
|
||||
return <div>已停止</div>;
|
||||
}
|
||||
},
|
||||
show: compute(({ form }) => {
|
||||
return form.radio !== "0";
|
||||
})
|
||||
}
|
||||
},
|
||||
name: {
|
||||
title: "姓名",
|
||||
type: "text"
|
||||
|
||||
@@ -21,6 +21,7 @@ export default defineComponent({
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
crudExpose.doRefresh();
|
||||
crudExpose.editable.enable({ mode: "row" });
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user