fix(Picker): failed to render text type (#8138)

This commit is contained in:
neverland 2021-02-12 13:02:01 +08:00 committed by GitHub
parent 7355b610e1
commit ba69a212ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,13 +75,15 @@ export default createComponent({
const dataType = computed(() => {
const firstColumn = props.columns[0];
if (typeof firstColumn === 'string') {
return 'text';
if (firstColumn && typeof firstColumn !== 'string') {
if (childrenKey in firstColumn) {
return 'cascade';
}
if (valuesKey in firstColumn) {
return 'object';
}
}
if (childrenKey in firstColumn) {
return 'cascade';
}
return 'object';
return 'text';
});
const formatCascade = () => {