c-dialog.vue 1.0 KB

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