Skip to content

Commit

Permalink
feat: 发布v1.2.6版本
Browse files Browse the repository at this point in the history
  • Loading branch information
liwei committed Dec 8, 2021
1 parent 72f8c6d commit 1a7f4e8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/packages/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ export const Component = (createElement, vm, key, item) => {

// 组件default如果是动态, 需要重新设置该组件的value
if (isEmpty(value) && typeof value !== 'boolean' && !isEmpty(item.default)) {
eval(`formValues.${name} = item.default`)
if (tag === 'el-select') {
// 下拉组件,有全部选项,全部值为空且默认值不是全部的问题
if (!items.map(selItem => selItem[keys.value]).some(itemVal => itemVal === value)) {
eval(`formValues.${name} = item.default`)
}
} else {
eval(`formValues.${name} = item.default`)
}
}

// 合并事件
Expand Down
2 changes: 1 addition & 1 deletion src/packages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ export default {
*/
getValidateProps(field) {
const val = getObjectByPath(this.formValues, field)
if (typeof val !== 'object' && !Array.isArray(val)) {
if ((typeof val !== 'object' && !Array.isArray(val)) || val === null) {
return [field]
} else if (Array.isArray(val)) {
return val.length === 0 ? [field] : val.map((item, index) => this.getValidateProps(`${field}[${index}]`)).flat(Infinity)
Expand Down
2 changes: 1 addition & 1 deletion vuepressdocs/.vuepress/components/example/array/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default {
id: "",
},
on: {
$addRow(scope) {
delete(scope) {
console.log(scope);
scope.row.disabled = true;
}
Expand Down

0 comments on commit 1a7f4e8

Please sign in to comment.