sh-view 2.10.0 → 2.10.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sh-view",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.2",
|
|
4
4
|
"description": "基于vxe-table二次封装,更包含Alert,Badge,Card,CodeEditor,Col,Corner,CountTo,Drawer,Empty,Form,Header,Icon,List,Loading,Modal,Noticebar,Poptip,Progress,PullRefresh,Query,Result,Row,Split,Grid,Table,Tabs,Tag,Toolbar,Tree,Upload,WaterFall,WaterMark等丰富组件库",
|
|
5
5
|
"main": "packages/index.js",
|
|
6
6
|
"typings": "types/index.d.ts",
|
|
@@ -23,7 +23,7 @@ const titleConfigDefault = {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export default function (props, context, proxy, isForm) {
|
|
26
|
-
const { $vUtils } = proxy
|
|
26
|
+
const { $vUtils, $vUiSetup } = proxy
|
|
27
27
|
const { emit, slots } = context
|
|
28
28
|
|
|
29
29
|
const formRef = ref()
|
|
@@ -34,13 +34,14 @@ export default function (props, context, proxy, isForm) {
|
|
|
34
34
|
const formItems = ref([])
|
|
35
35
|
const formRules = ref({})
|
|
36
36
|
|
|
37
|
+
const formVmConfig = computed(() => ({ size: props.size || $vUiSetup.size }))
|
|
37
38
|
const formBindConfig = computed(() => {
|
|
38
39
|
let formulaMap = {}
|
|
39
40
|
$vUtils.eachTree(props.items, column => {
|
|
40
41
|
let rformula = $vUtils.get(column, 'renderProps.formula')
|
|
41
42
|
if (rformula) formulaMap[column.field] = rformula
|
|
42
43
|
})
|
|
43
|
-
return Object.assign({
|
|
44
|
+
return Object.assign({}, formConfigDefault, props.formConfig, formVmConfig.value, {
|
|
44
45
|
items: formItems.value,
|
|
45
46
|
data: props.data,
|
|
46
47
|
rules: props.valid ? formRules.value : {},
|
|
@@ -94,7 +95,6 @@ export default function (props, context, proxy, isForm) {
|
|
|
94
95
|
}
|
|
95
96
|
// 表单验证抛异常
|
|
96
97
|
const validateCatch = async callback => {
|
|
97
|
-
return formRef.value.validate(callback)
|
|
98
98
|
let validateResult = await formRef.value.validate(callback)
|
|
99
99
|
if (validateResult) {
|
|
100
100
|
return Promise.reject(validateResult)
|