Kaynağa Gözat

dynamic table update

abpcoder 1 ay önce
ebeveyn
işleme
b100f330b0

+ 7 - 3
src/components/dynamic-table/dynamic-table-column.vue

@@ -10,8 +10,12 @@
         {{ scope.row[column.prop] }}
       </slot>
     </template>
-    <dynamic-table-column v-for="child in visibleChildren" :key="child.prop" :column="child"
-                          :default-setting="defaultSetting">
+    <dynamic-table-column
+      v-for="child in visibleChildren"
+      :key="child.prop"
+      :column="child"
+      :default-setting="defaultSetting"
+    >
       <template v-for="slot in Object.keys($scopedSlots)" #[slot]="scope">
         <slot :name="slot" v-bind="scope">
           {{ scope.display }}
@@ -23,7 +27,7 @@
 
 <script>
 export default {
-  name: 'dynamic-table-column',
+  name: 'DynamicTableColumn',
   props: {
     column: { type: Object, default: () => ({ prop: '', slotBody: '', slotHeader: '', children: [] }) },
     defaultSetting: { type: Object, default: () => ({}) }

+ 8 - 4
src/components/dynamic-table/index.vue

@@ -1,7 +1,11 @@
 <template>
   <el-table ref="table" :data="rows" v-bind="mergedAttrs" v-on="$listeners">
-    <dynamic-table-column v-for="column in visibleColumns" :key="column.prop" :column="column"
-                          :default-setting="columnDefaultSetting">
+    <dynamic-table-column
+      v-for="column in visibleColumns"
+      :key="column.prop || column.label"
+      :column="column"
+      :default-setting="columnDefaultSetting"
+    >
       <template v-for="slot in Object.keys($scopedSlots)" #[slot]="scope">
         <slot :name="slot" v-bind="scope">
           {{ scope.display }}
@@ -19,7 +23,7 @@
 import DynamicTableColumn from '@/components/dynamic-table/dynamic-table-column'
 
 export default {
-  name: 'dynamic-table',
+  name: 'DynamicTable',
   components: { DynamicTableColumn },
   props: {
     rows: { type: Array, default: () => [] },
@@ -36,7 +40,7 @@ export default {
     },
     tableCore() {
       return this.$refs.table
-    },
+    }
   }
 }
 </script>

+ 2 - 2
src/views/career/plan/new-major-lib.vue

@@ -133,10 +133,10 @@ export default {
       display: inline-block;
       line-height: 40px;
       &:hover{
-        color:#47C6A2;
+        color: var(--themeColor);
       }
       &.bg-primary{
-        background: #47C6A2 ;
+        background: var(--themeColor);
         color: white;
         border: 0px;
       }