tianheng-ui 0.0.70 → 0.0.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tianheng-ui",
3
3
  "description": "A Vue.js project",
4
- "version": "0.0.70",
4
+ "version": "0.0.71",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -1,29 +1,35 @@
1
1
  <template>
2
2
  <el-dialog
3
3
  class="th-dialog"
4
+ :class="[customClass]"
4
5
  :visible.sync="visible"
6
+ :width="width"
7
+ :top="top"
5
8
  :fullscreen="dialogFullscreen"
6
- :close-on-click-modal="false"
9
+ :close-on-click-modal="closeOnClickModal"
10
+ :close-on-press-escape="closeOnPressEscape"
7
11
  :show-close="false"
8
- :before-close="handleClose"
12
+ :modal="modal"
13
+ :modal-append-to-body="modalAppendToBody"
14
+ :append-to-body="appendToBody"
15
+ :before-close="handleBeforeClose"
16
+ :destroy-on-close="destroyOnClose"
9
17
  >
10
- <div slot="title">
11
- <div slot="title" class="th-dialog__header">
12
- <div class="th-dialog__title">{{ title }}</div>
13
- <div class="th-dialog__action">
14
- <i
15
- v-if="showFullscreen"
16
- class="th-dialog__action_item"
17
- :class="fullscreenIcon"
18
- @click="handleFullscreenChange"
19
- ></i>
20
- <i
21
- v-if="showClose"
22
- class="th-dialog__action_item "
23
- :class="closeIcon"
24
- @click="handleClose"
25
- ></i>
26
- </div>
18
+ <div slot="title" class="th-dialog__header">
19
+ <div class="th-dialog__title">{{ title }}</div>
20
+ <div class="th-dialog__action">
21
+ <i
22
+ v-if="showFullscreen"
23
+ class="th-dialog__action_item"
24
+ :class="fullscreenIcon"
25
+ @click="handleFullscreenChange"
26
+ ></i>
27
+ <i
28
+ v-if="showClose"
29
+ class="th-dialog__action_item "
30
+ :class="closeIcon"
31
+ @click="handleBeforeClose"
32
+ ></i>
27
33
  </div>
28
34
  </div>
29
35
  <slot />
@@ -57,6 +63,17 @@ export default {
57
63
  visible: Boolean,
58
64
  loading: Boolean,
59
65
  title: { type: String, default: "" },
66
+ width: { type: String, default: "800px" },
67
+ fullscreen: { type: Boolean, default: false },
68
+ top: { type: String, default: "15vh" },
69
+ modal: { type: Boolean, default: true },
70
+ modalAppendToBody: { type: Boolean, default: true },
71
+ appendToBody: { type: Boolean, default: false },
72
+ customClass: String,
73
+ closeOnClickModal: { type: Boolean, default: false },
74
+ closeOnPressEscape: { type: Boolean, default: false },
75
+ beforeClose: Function,
76
+ destroyOnClose: { type: Boolean, default: false },
60
77
 
61
78
  showAffirm: { type: Boolean, default: true },
62
79
  affirmText: { type: String, default: "确 认" },
@@ -67,7 +84,6 @@ export default {
67
84
  showClose: { type: Boolean, default: true },
68
85
  closeIcon: { type: String, default: "el-icon-close" },
69
86
 
70
- fullscreen: { type: Boolean, default: false },
71
87
  showFullscreen: { type: Boolean, default: true },
72
88
  fullscreenIcon: { type: String, default: "el-icon-full-screen" },
73
89
 
@@ -89,6 +105,16 @@ export default {
89
105
  this.$emit("input", !this.visible);
90
106
  this.$emit("on-close");
91
107
  },
108
+ handleBeforeClose(done) {
109
+ if (this.beforeClose) {
110
+ const callback = () => {
111
+ this.handleClose();
112
+ };
113
+ this.beforeClose(callback);
114
+ } else {
115
+ this.handleClose();
116
+ }
117
+ },
92
118
  handleAffirm() {
93
119
  this.$emit("on-affirm");
94
120
  },
@@ -28,9 +28,10 @@ export default {
28
28
  deep: true
29
29
  },
30
30
  value(val) {
31
- this.data = val
31
+ this.data = val;
32
32
  }
33
- }
33
+ },
34
+ methods: {}
34
35
  };
35
36
  </script>
36
37