@elementplus-kit/uikit 1.2.0 → 1.3.0
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.
|
@@ -50,6 +50,7 @@ const propsAttrs = {
|
|
|
50
50
|
options: { type: Array, default: () => [] },
|
|
51
51
|
// 字典选项
|
|
52
52
|
optionsRef: { type: Object, default: () => {} },
|
|
53
|
+
params: { type: Object, default: () => {} },
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
export default defineComponent({
|
|
@@ -107,7 +108,7 @@ export default defineComponent({
|
|
|
107
108
|
const getDisabled = () => {
|
|
108
109
|
let disabled = false;
|
|
109
110
|
if (isFunction(attrs.value?.disabled)) {
|
|
110
|
-
disabled = attrs.value.disabled(model.value);
|
|
111
|
+
disabled = attrs.value.disabled({formData: model.value, params: props.params});
|
|
111
112
|
}
|
|
112
113
|
if (isBoolean(attrs.value?.disabled)) { // 在 attrs 后面结构, 也要处理直接赋值的情况,不然会覆盖
|
|
113
114
|
disabled = attrs.value.disabled;
|
|
@@ -186,7 +187,6 @@ export default defineComponent({
|
|
|
186
187
|
return options?.value?.map((item) => {
|
|
187
188
|
return h(ElOption, {
|
|
188
189
|
...item,
|
|
189
|
-
// disabled: isFunction(item.disabled) ? item.disabled(model.value) : item.disabled,
|
|
190
190
|
label: item.label,
|
|
191
191
|
value: item.value,
|
|
192
192
|
key: item.value,
|
|
@@ -108,8 +108,8 @@ export default defineComponent({
|
|
|
108
108
|
const list = [];
|
|
109
109
|
formOptions.value.map((item) => {
|
|
110
110
|
// 处理 vIf true 显示 false 隐藏
|
|
111
|
-
if (isFunction(item?.vIf) && item.vIf(
|
|
112
|
-
if (item.vIf(
|
|
111
|
+
if (isFunction(item?.vIf) && item.vIf({formData: model.value, params: props.params}) !== undefined) {
|
|
112
|
+
if (item.vIf({formData: model.value, params: props.params})) {
|
|
113
113
|
list.push(item);
|
|
114
114
|
}
|
|
115
115
|
} else {
|
|
@@ -124,6 +124,7 @@ export default defineComponent({
|
|
|
124
124
|
class: "c-form-itme",
|
|
125
125
|
model: model.value,
|
|
126
126
|
allReadonly,
|
|
127
|
+
params: props.params,
|
|
127
128
|
...item,
|
|
128
129
|
optionsRef: optionsRef.value,
|
|
129
130
|
});
|