AntDesign中card卡片动态添加bodystyle样式,实现body切换

业务效果

核心代码

<template>
<a-layout class="layout">
<a-layout-header class="header" style="height: 50px">
<div class="wrapper content">
<span class="info">非标数据</span>
<span class="backBtn">
<img src="@/assets/data/u279.svg"/>
返回
</span>
</div>
</a-layout-header>
<a-layout-content class="main" style="margin-top: 25px;">
<div class="wrapper content">
<a-card title="查询条件" headStyle="background: #f3f3f3"
:bodyStyle='bodyStyle'>
<template #extra>
<a-button type="link" @click="formVisible = !formVisible" style="font-size: 13px;border: none">收起筛选</a-button>
<a-button>查询结果</a-button>
</template>
<p>card content</p>
<p>card content</p>
<p>card content</p>
</a-card>
</div>
</a-layout-content>
</a-layout>
</template>
<script setup lang='ts'>
import {ref, reactive, watch, computed} from "vue"
const formVisible = ref(true);
const bodyStyle = computed(() => {
console.log('formVisible', formVisible)
return formVisible.value ? {"display": "block"} : {"display": "none"}
})
</script>
posted @   Felix_Openmind  阅读(1444)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· AI 智能体引爆开源社区「GitHub 热点速览」
· 写一个简单的SQL生成工具
*{cursor: url(https://files-cdn.cnblogs.com/files/morango/fish-cursor.ico),auto;}
点击右上角即可分享
微信分享提示