@@ -27,7 +27,7 @@ const props = withDefaults(
)
const isLeaf = computed(() => {
- return props.isLazy ? !!props.row[props.leafField] : false
+ return props.isLazy ? toBoolean(props.row[props.leafField]) : false
})
const tooltip = (col: Header) => {
@@ -47,6 +47,14 @@ export function parseTime(time: Date | string | number, pattern: string) {
return time_str
}
+export function toBoolean(val: any) {
+ val = val.toString()
+ if (val == "1" || val.toUpperCase() == "Y" || val.toUpperCase() == "TRUE") {
+ return true
+ }
+ return false
+}
+
// 表单重置
export function resetForm(this: any, refName: string) {
if (this.$refs[refName]) {