index2.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <div>
  3. <el-button :type="disabled?'':btnType" size="mini" :disabled="disabled" @click="dialogShow">{{$t(btnTitle)}}</el-button>
  4. <el-dialog :title="dialogTitle?$t(dialogTitle):$t(`提示`)" :visible.sync="dialogTableVisible" append-to-body :show-close="false" width="600px">
  5. <slot name="formRule"></slot>
  6. <div slot="footer" class="dialog-footer">
  7. <el-button @click="onCancel" size="small">{{$t(`取 消`)}}</el-button>
  8. <el-button type="primary" @click="onSubmit" size="small">{{$t(`确 定`)}}</el-button>
  9. </div>
  10. </el-dialog>
  11. </div>
  12. </template>
  13. <script>
  14. export default {
  15. name: "index1",
  16. props:["btnTitle","disabled","btnType","content",'dialogTitle'],
  17. data(){
  18. return {
  19. dialogTableVisible:false,
  20. }
  21. },
  22. methods:{
  23. dialogShow(){
  24. this.dialogTableVisible = true
  25. },
  26. onCancel(){
  27. this.dialogTableVisible = false
  28. this.$emit('onCancel')
  29. },
  30. onSubmit(){
  31. this.$emit('onSubmit')
  32. }
  33. }
  34. }
  35. </script>
  36. <style scoped>
  37. /deep/ .el-dialog__body {
  38. padding: 0 20px 20px 20px !important;
  39. }
  40. </style>