1
This commit is contained in:
22
uview-plus/components/u-form/form.js
Normal file
22
uview-plus/components/u-form/form.js
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* @Author : LQ
|
||||
* @Description :
|
||||
* @version : 1.0
|
||||
* @Date : 2021-08-20 16:44:21
|
||||
* @LastAuthor : LQ
|
||||
* @lastTime : 2021-08-20 17:03:49
|
||||
* @FilePath : /u-view2.0/uview-ui/libs/config/props/form.js
|
||||
*/
|
||||
export default {
|
||||
// form 组件
|
||||
form: {
|
||||
model: {},
|
||||
rules: {},
|
||||
errorType: 'message',
|
||||
borderBottom: true,
|
||||
labelPosition: 'left',
|
||||
labelWidth: 45,
|
||||
labelAlign: 'left',
|
||||
labelStyle: {}
|
||||
}
|
||||
}
|
||||
47
uview-plus/components/u-form/props.js
Normal file
47
uview-plus/components/u-form/props.js
Normal file
@@ -0,0 +1,47 @@
|
||||
import { defineMixin } from '../../libs/vue'
|
||||
import defProps from '../../libs/config/props.js'
|
||||
export const props = defineMixin({
|
||||
props: {
|
||||
// 当前form的需要验证字段的集合
|
||||
model: {
|
||||
type: Object,
|
||||
default: () => defProps.form.model
|
||||
},
|
||||
// 验证规则
|
||||
rules: {
|
||||
type: [Object, Function, Array],
|
||||
default: () => defProps.form.rules
|
||||
},
|
||||
// 有错误时的提示方式,message-提示信息,toast-进行toast提示
|
||||
// border-bottom-下边框呈现红色,none-无提示
|
||||
errorType: {
|
||||
type: String,
|
||||
default: () => defProps.form.errorType
|
||||
},
|
||||
// 是否显示表单域的下划线边框
|
||||
borderBottom: {
|
||||
type: Boolean,
|
||||
default: () => defProps.form.borderBottom
|
||||
},
|
||||
// label的位置,left-左边,top-上边
|
||||
labelPosition: {
|
||||
type: String,
|
||||
default: () => defProps.form.labelPosition
|
||||
},
|
||||
// label的宽度,单位px
|
||||
labelWidth: {
|
||||
type: [String, Number],
|
||||
default: () => defProps.form.labelWidth
|
||||
},
|
||||
// lable字体的对齐方式
|
||||
labelAlign: {
|
||||
type: String,
|
||||
default: () => defProps.form.labelAlign
|
||||
},
|
||||
// lable的样式,对象形式
|
||||
labelStyle: {
|
||||
type: Object,
|
||||
default: () => defProps.form.labelStyle
|
||||
}
|
||||
}
|
||||
})
|
||||
252
uview-plus/components/u-form/u-form.vue
Normal file
252
uview-plus/components/u-form/u-form.vue
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user