Skip to content

Commit

Permalink
Merge pull request #149 from zhanghangt/patch-3
Browse files Browse the repository at this point in the history
Update card.vue
  • Loading branch information
kanyxmo authored Apr 16, 2024
2 parents 6bd6e9c + e1630ed commit 7c179c1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/ma-form/containerItem/card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
-->
<template>
<a-card
v-if="(typeof props.component?.display == 'undefined' || props.component?.display === true)"
v-if="(typeof props.component?.display == 'undefined' ||
props.component?.display === true) &&
(hasDisplayTrue((props.component?.formList ?? [])) ||
props.component?.forceShow)"
:class="[props.component?.customClass]"
:extra="props.component?.extra"
:bordered="props.component?.bordered"
Expand Down Expand Up @@ -53,8 +56,13 @@ const props = defineProps({ component: Object })
const formModel = inject('formModel')
const getColumnService= inject('getColumnService')
const columns = inject('columns')

const hasDisplayTrue = (list) => {
return list.some(item => item.display === true);
}

const rv = async (ev, value = undefined) => await runEvent(props.component, ev, { formModel, getColumnService, columns }, value)

rv('onCreated')
onMounted(() => rv('onMounted'))
</script>
</script>

0 comments on commit 7c179c1

Please sign in to comment.