Browse Source

添加其他按钮

lifanagju_citu 6 months ago
parent
commit
8ae9b6c6ac
1 changed files with 16 additions and 1 deletions
  1. 16 1
      src/components/CtDialog/index.vue

+ 16 - 1
src/components/CtDialog/index.vue

@@ -42,6 +42,14 @@
           >
           >
             {{ closeText }}
             {{ closeText }}
           </v-btn>
           </v-btn>
+          <v-btn
+            v-if="props.otherBtnText"
+            color="primary"
+            text
+            @click="handleOtherBtn"
+          >
+            {{ otherBtnText }}
+          </v-btn>
           <v-btn
           <v-btn
             color="primary"
             color="primary"
             text
             text
@@ -61,7 +69,7 @@
 <script setup>
 <script setup>
 import { ref, computed, watch  } from 'vue'
 import { ref, computed, watch  } from 'vue'
 defineOptions({ name: 'components-ct-dialog' })
 defineOptions({ name: 'components-ct-dialog' })
-const emits = defineEmits(['update:visible', 'close', 'submit'])
+const emits = defineEmits(['update:visible', 'close', 'other', 'submit'])
 
 
 const props = defineProps({
 const props = defineProps({
   titleClass: {
   titleClass: {
@@ -100,6 +108,10 @@ const props = defineProps({
     type: Boolean,
     type: Boolean,
     default: false
     default: false
   },
   },
+  otherBtnText: {
+    type: String,
+    default: ''
+  },
   closeable: {
   closeable: {
     type: Boolean,
     type: Boolean,
     default: true
     default: true
@@ -123,6 +135,9 @@ const handleClose = () => {
   // emits('update:visible', false)
   // emits('update:visible', false)
   emits('close', false)
   emits('close', false)
 }
 }
+const handleOtherBtn = () => {
+  emits('other', false)
+}
 const handleSave = () => {
 const handleSave = () => {
   emits('submit', false)
   emits('submit', false)
 }
 }