From 423a25b7644f789b4528ee14d4e7eb516bfad7b0 Mon Sep 17 00:00:00 2001 From: whychdw <49690745@qq.com> Date: 星期三, 19 五月 2021 16:08:08 +0800 Subject: [PATCH] 新建试验 --- src/components/smallModule/TestCard.vue | 97 +++++++++++++++++++++++++----------------------- 1 files changed, 51 insertions(+), 46 deletions(-) diff --git a/src/components/smallModule/TestCard.vue b/src/components/smallModule/TestCard.vue index 5a72b15..cea3ba0 100644 --- a/src/components/smallModule/TestCard.vue +++ b/src/components/smallModule/TestCard.vue @@ -1,67 +1,72 @@ <template> - <div class="test-card"> - <div class="test-card-title"><slot name="title">{{title}}</slot></div> - <div class="test-card-content"> - <slot></slot> + <div class="test-card"> + <div class="test-card-title" v-if="!noHeader"> + <slot name="title">{{ title }}</slot> + </div> + <div class="test-card-content"> + <slot></slot> + </div> + <div class="test-card-footer" v-if="!noFooter"> + <slot name="footer"></slot> + </div> </div> - <div class="test-card-footer" v-if="!noFooter"> - <slot name="footer"></slot> - </div> - </div> </template> <script> export default { - name: "TestCard", - props: { - title: { - type: String, - default: "" + name: "TestCard", + props: { + title: { + type: String, + default: "" + }, + noHeader: { + type: Boolean, + default: false + }, + noFooter: { + type: Boolean, + default: false + } }, - noFooter: { - type: Boolean, - default: false + data() { + return {} + }, + methods: {}, + computed: {}, + mounted() { + } - }, - data() { - return {} - }, - methods: { - - }, - computed: { - - }, - mounted() { - - } } </script> <style scoped> .test-card { - background-color: #FFFFFF; - box-sizing: border-box; - border: 1px solid #e2e2e2; + background-color: #FFFFFF; + box-sizing: border-box; + border: 1px solid #e2e2e2; } + .test-card-title { - background-color: rgb(242, 242, 242); - line-height: 50px; - padding-left: 16px; - font-size: 16px; - font-weight: 700; - color: #666666; - font-family: "寰蒋闆呴粦 Bold", "寰蒋闆呴粦 Regular", 寰蒋闆呴粦, sans-serif; - box-sizing: border-box; - border-bottom: 1px solid #e2e2e2; + background-color: rgb(242, 242, 242); + line-height: 50px; + padding-left: 16px; + font-size: 16px; + font-weight: 700; + color: #666666; + font-family: "寰蒋闆呴粦 Bold", "寰蒋闆呴粦 Regular", 寰蒋闆呴粦, sans-serif; + box-sizing: border-box; + border-bottom: 1px solid #e2e2e2; } + .test-card-content { - box-sizing: border-box; - padding: 8px; + box-sizing: border-box; + padding: 8px; } + .test-card-footer { - padding-right: 16px; - box-sizing: border-box; - border-top: 1px solid #e2e2e2; + padding-right: 16px; + box-sizing: border-box; + border-top: 1px solid #e2e2e2; } </style> \ No newline at end of file -- Gitblit v1.9.1