Переглянути джерело

feat: 添加操作记录主键属性传参

aXin-0810 2 роки тому
батько
коміт
298630c691
1 змінених файлів з 11 додано та 1 видалено
  1. 11 1
      src/components/template/template-page-1.vue

+ 11 - 1
src/components/template/template-page-1.vue

@@ -75,6 +75,10 @@ export default {
     operation: {
       type: Function
     },
+    operationRecordkey: {
+      type: String,
+      default: 'id'
+    },
     cstomClumn: {
       type: Function
     },
@@ -143,7 +147,13 @@ export default {
     caozuojl(h, { row, index, column }) {
       return (
         <div class="operation-btns">
-          <el-button size="mini" type="text" onClick={() => {}}>
+          <el-button
+            size="mini"
+            type="text"
+            onClick={() => {
+              console.log(row[this.operationRecordkey])
+            }}
+          >
             操作记录
           </el-button>
           {this.operation(h, { row, index, column })}