Browse Source

card卡片样式微调

tianyabing 2 years ago
parent
commit
6d91391190
2 changed files with 18 additions and 10 deletions
  1. 15 10
      src/components/common/card.vue
  2. 3 0
      vite.config.js

+ 15 - 10
src/components/common/card.vue

@@ -1,7 +1,10 @@
 <template>
-  <div>
+  <div class="ioc-card">
     <div class="card_title">
-      {{ title }}
+      <slot name="title">{{ title }}</slot>
+      <span style="float: right">
+        <slot name="title-extra"></slot>
+      </span>
     </div>
     <slot></slot>
   </div>
@@ -19,13 +22,15 @@ export default {
 </script>
 
 <style lang="less" scoped>
-.card_title {
-  padding-left: 10px;
-  height: 20px;
-  line-height: 20px;
-  margin: 10px 0px;
-  font-size: 16px;
-  font-weight: bold;
-  border-left: 8px solid #98d4f3;
+.ioc-card {
+  .card_title {
+    padding: 10px 0px 10px 15px;
+    //height: 20px;
+    //line-height: 20px;
+    font-size: 16px;
+    font-weight: bold;
+    //border-left: 8px solid #98d4f3;
+  }
 }
+
 </style>

+ 3 - 0
vite.config.js

@@ -29,6 +29,9 @@ export default defineConfig(({ command }) => {
     build: {
       outDir: 'dist',
       sourcemap: false,
+      commonjsOptions: {
+        transformMixedEsModules: true
+      },
       chunkSizeWarningLimit: 1000,
       rollupOptions: {
         output: {