🔱: [client] sync upgrade with 3 commits [trident-sync]

docs: vModel支持trim、number doc
perf: vModel支持trim、number

https://github.com/fast-crud/fast-crud/issues/182
pull/14/head
GitHub Actions Bot 2023-04-28 19:24:08 +00:00
parent 3e4a8f230f
commit 508fe69cf8
2 changed files with 52 additions and 0 deletions

View File

@ -37,6 +37,56 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
}
}
},
trim: {
title: "trim空格",
type: "text", //虽然不写也能正确显示组件,但不建议省略它
search: { show: true },
form: {
component: {
vModel: {
name: "value",
trim: true
},
maxlength: 20
},
helper: "自动移除两端空格"
}
},
number: {
title: "转换为number",
type: "text", //虽然不写也能正确显示组件,但不建议省略它
search: { show: true },
form: {
component: {
vModel: {
name: "value",
number: true
},
maxlength: 20
},
helper: "自动转为number"
}
},
transform: {
title: "自定义transform",
type: "text", //虽然不写也能正确显示组件,但不建议省略它
search: { show: true },
form: {
component: {
vModel: {
name: "value",
transform: (value) => {
if (!value) {
return undefined;
}
return value;
}
},
maxlength: 20,
helper: "自定义transform方法此处演示空字符串转为undefined"
}
}
},
search: {
title: "搜索",
type: "text",

View File

@ -8,6 +8,8 @@ const list = [
name: "王小虎",
date: "2016-05-02",
status: "0",
trim: " aa aa ",
number: "123",
province: "1",
avatar: "https://alicdn.antdv.com/vue.png",
show: true,