e-dialog.vue 939 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <div id="e-dialog">
  3. <el-dialog :title="dialog.title" :visible.sync="dialog.show" width="40%" :before-close="toClose" :close-on-click-modal="false" :append-to-body="true">
  4. <slot name="info"></slot>
  5. </el-dialog>
  6. </div>
  7. </template>
  8. <script>
  9. import { mapState, createNamespacedHelpers } from 'vuex';
  10. export default {
  11. name: 'e-dialog',
  12. props: {
  13. dialog: { type: Object, default: () => {} },
  14. },
  15. components: {},
  16. data: function() {
  17. return {};
  18. },
  19. created() {},
  20. methods: {
  21. toClose() {
  22. this.$emit('toClose');
  23. },
  24. },
  25. computed: {
  26. ...mapState(['user']),
  27. },
  28. metaInfo() {
  29. return { title: this.$route.meta.title };
  30. },
  31. watch: {
  32. test: {
  33. deep: true,
  34. immediate: true,
  35. handler(val) {},
  36. },
  37. },
  38. };
  39. </script>
  40. <style lang="less" scoped>
  41. /deep/.el-dialog__body {
  42. padding: 10px;
  43. min-height: 30px;
  44. max-height: 400px;
  45. overflow-y: auto;
  46. }
  47. </style>